Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

Why strings are shown partially in the Visual Studio 2008 debugger?

I'm debugging a C++ application with VS2008 and with some long select queries I'm not able to see the full text in the debugger. It just shows a part of the query.

Is there a way to see the full text?

Thanks in advance.

enter image description here

EDIT: The real query available at the string is:

select  c.cd_seq, m.diag_code, m.diag_descr, 'S' as source 
from custom_booking_data c 
left outer join meddiagnosis m 
on c.cd_number_value = convert( decimal( 28, 8 ), m.diag_urn ) 
where c.custom_data_urn = 4 and c.cd_field = 433 
union 
select  c.cd_seq, m.diag_code, m.diag_descr, 'H' as source 
from custom_booking_data c 
left outer join ordiagnosis m 
on c.cd_number_value = convert( decimal( 28, 8 ), m.diag_urn ) 
where c.custom_data_urn = 4 and c.cd_field = 594

Not that long if you ask me.

Upvotes: 18

Views: 8561

Answers (5)

Jonathan Hudgins
Jonathan Hudgins

Reputation: 21

This is in a comment but really is the answer I was looking for: File.WriteAllText(@"C:\Temp\temp.txt", str)

Upvotes: 2

Sameera Kumarasingha
Sameera Kumarasingha

Reputation: 2988

Hover the variable you want to view, then click on the magnifier icon following icon, or select the arrow right to the icon and select Text from the drop down menu

enter image description here

This is the result, i think you asked this...

enter image description here

Upvotes: 17

Brad Oestreicher
Brad Oestreicher

Reputation: 1211

This seems to be a 'feature' in Visual Studio. I see the same thing in VS2012 using C#, with a string that is just over 500 characters.

The solution that I found was to right click on the variable in the debugger and do a 'Quick Watch' on it. The string is not truncated in the Quick Watch window.

Upvotes: 4

codymanix
codymanix

Reputation: 29520

Could it be that your string contains NUL '\0' values? Textbox controls like the ones the debugger is using will interpret them as the end of the string.

Upvotes: 1

Javi R
Javi R

Reputation: 2350

I think you can right-click the item and then 'copy to clipboard'. Then paste it into another text editor.

Upvotes: 0

Related Questions