Why I can't show the string normally in gdb?
source:
char *pid_file...
gdb:
(gdb) p (char *)pid_file
$47 = 0x423047 "H\215\005\366i "
(gdb) x/s pid_file
开发者_运维技巧0x423047 <__libc_csu_init+55>: "H\215\005\366i "
What's wrong here?
It looks like pid_file has not been assigned to any valid string yet, and points to arbitrary "garbage". You've elided the most relevant part ;-(
精彩评论