This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: printing a string
Jim Blandy wrote:
Andrew STUBBS <andrew.stubbs at st.com> writes:
printf "%s\n", mystring
(Not 'set print elements'?)
Well, 'set print elements 0' and 'set print repeats 0' gets you some of
the way there, but line-feeds still get converted to '\n', and if you
want to print shorter strings with x/s then you'll also need 'set print
null-stop on' .....
Basically, if you want to see a string as nature intended then printf
seems to be the easiest way, plus x/s remains useful for viewing the
contents of the string a different way.
Andrew