views:

151

answers:

1

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 '\t' 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.

+1  A: 

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.

Alex Blekhman