Using set elements ...
isn't always the best way. It would be useful if there were a distinct set string-elements ...
.
So, I use these functions in my .gdbinit:
define pstr
ptype $arg0._M_dataplus._M_p
printf "[%d] = %s\n", $arg0._M_string_length, $arg0._M_dataplus._M_p
end
define pcstr
ptype $arg0
printf "[%d] = %s\n", strlen($arg0), $arg0
end
Caveats: