GDB print string in an wrong format, a little like octal string

社会主义新天地 提交于 2019-12-11 06:03:33

问题


I show charset in my gdb:

The host character set is "UTF-8".
The target character set is "UTF-8".
The target wide character set is "auto; currently UTF-32".

But when I try to output a string in a register

p (char*) $register

I got a very strange string which hard to recognise:

$16 = 0x100001040 "A\020\021\021\033\ndgjhbhnghkb=ejj=h\004\005\b\003 ...

I am sure that if the string is purely ascii, all works fine.

So what should I do to get the string I want to see?

来源:https://stackoverflow.com/questions/44196215/gdb-print-string-in-an-wrong-format-a-little-like-octal-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!