Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 490
Ignacio Soler Garcia Avatar asked Mar 22 '11 16:03

Ignacio Soler Garcia


People also ask

How do I change Debug in Visual Studio?

To set Visual Studio debugger options, select Tools > Options, and under Debugging select or deselect the boxes next to the General options. You can restore all default settings with Tools > Import and Export Settings > Reset all settings.

How can you see variable references while debugging?

When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.


2 Answers

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

like image 83
Sameera Kumarasingha Avatar answered Oct 21 '22 11:10

Sameera Kumarasingha


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.

like image 36
Brad Oestreicher Avatar answered Oct 21 '22 09:10

Brad Oestreicher