Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio insert tabs/newlines in breakpoint print message (tracepoint)?

Anyone know how to place a tab or newline into the print message of a breakpoint and have it show up correctly?

Thus far I've tried '\t' and '\n' which give the same thing in the debug output. I've also tried just putting in 4 spaces, but they get removed after I click OK in the 'When Breakpoint is Hit' dialog.

I'm using VS.NET 2008 with native code if that makes a difference.

Thanks.

like image 586
adam Avatar asked Feb 24 '10 16:02

adam


1 Answers

You can specify any character in the message by including it in curly braces. For example, this will insert new line in the message: {'\n'}. The problem is that character's value and single quotes will be printed, too. I tried to disable output of the character's value with all kinds of expression formatting, but nothing helps.

It is a bit clumsy solution, but it works if you need to break long statement into several lines. Other character are OK, as well. But don't put strings ({"\r\n"}). It seems that VS debugger is able to print only single characters, but string literals.

like image 152
Alex Blekhman Avatar answered Oct 03 '22 06:10

Alex Blekhman