I'm printing a string(char *) in gdb
(gdb) p l
l=0x9aa1f48 "up2 129104596496602200 19 0 0 3 0 eth1 XX :001CB",'0' <repeats 12 times>, "DC"
Is there a setting to have p
print the whole string and not fill inn the "repeats ... ". While at it - also extend the default printable length of a string, p
seems to cut off if the string is quite long.
set print repeats 0
Example:
(gdb) p "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
$6 = 'a' <repeats 30 times>
(gdb) set print repeats 0
(gdb) p "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
$7 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
(gdb) set print repeats 10
(gdb) p "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
$8 = 'a' <repeats 30 times>
Use gdb's printf command like this:
(gdb) printf "%s\n", a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
instead of
(gdb) p a
$1 = 'a' <repeats 32 times>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With