0

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?

Wang Yi
  • 31
  • 1
  • 7
  • 1
    It seems that whatever is at the address contained in `register`, it is not a string. – fuz May 26 '17 at 09:00
  • I finally got the answer this might be a corrupted result. Your adjudgment is right that it is not a string but corrupted binary. I modified the codes and got the result I want. Thank you ! – Wang Yi May 27 '17 at 12:45

0 Answers0