Skip to main content



      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 10:57 Go to next message
Eclipse UserFriend
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 07:30 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: How to prevent string truncation in debugger's Variables window? [message #1434232 is a reply to message #1433891] Mon, 29 September 2014 17:23 Go to previous messageGo to next message
Eclipse UserFriend
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 08:50 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: How to prevent string truncation in debugger's Variables window? [message #1434976 is a reply to message #1434692] Tue, 30 September 2014 18:01 Go to previous message
Eclipse UserFriend
Thanks, Axel!
Previous Topic:Eclipse CDT 8.1 (OSX) Valgrind
Next Topic:Code analysis issues (unresolved symbols)
Goto Forum:
  


Current Time: Sun Aug 31 20:20:23 EDT 2025

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

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

Back to the top