Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to prevent string truncation in debugger's Variables window?(How to view string contents in debugger?)
How to prevent string truncation in debugger's Variables window? [message #1433307] Sun, 28 September 2014 14:57 Go to next message
Al Berg is currently offline Al BergFriend
Messages: 4
Registered: June 2014
Junior Member
When debugging C/C++ code in Eclipse CDT (Linux), in the debugger's Variables window only a part of the string's contents is shown for strings which are longer than 1024 characters or so. Right-clicking on the window and selecting "Max length..." with setting the max. length to big values or to 0 - doesn't change anything. Currently the only ways I know to see the whole string is via memory view or via "Display as array" menu item, but this is inconvenient. Is there a way to show the required length of string in the debugger's 'Variables' window?
Re: How to prevent string truncation in debugger's Variables window? [message #1433891 is a reply to message #1433307] Mon, 29 September 2014 11:30 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Did you limit the displayed lengh in your gdbinit file? AFAIK, the option "set print elements MAXLENGTH" would limit the output from gdb. It is also possible that the output length is limited by the pretty printer python script if you are using e.g. std::string.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: How to prevent string truncation in debugger's Variables window? [message #1434232 is a reply to message #1433891] Mon, 29 September 2014 21:23 Go to previous messageGo to next message
Al Berg is currently offline Al BergFriend
Messages: 4
Registered: June 2014
Junior Member
Alex,

There is no .gdbinit file on my computer. Does gdb have some displayed length limit by default? Or does Eclipse set this limit to gdb somewhere elese than in .gdbinit file? Is it by design that Eclipse out of the box truncates strings in debugger?
Re: How to prevent string truncation in debugger's Variables window? [message #1434692 is a reply to message #1434232] Tue, 30 September 2014 12:50 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
http://stackoverflow.com/questions/233328/how-do-i-print-the-full-value-of-a-long-string-in-gdb
With "show print elements" in a gdbinit file you can get the actual value.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: How to prevent string truncation in debugger's Variables window? [message #1434976 is a reply to message #1434692] Tue, 30 September 2014 22:01 Go to previous message
Al Berg is currently offline Al BergFriend
Messages: 4
Registered: June 2014
Junior Member
Thanks, Axel!
Previous Topic:Eclipse CDT 8.1 (OSX) Valgrind
Next Topic:Code analysis issues (unresolved symbols)
Goto Forum:
  


Current Time: Tue Apr 16 06:03:29 GMT 2024

Powered by FUDForum. Page generated in 0.08798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top