开发者

Why I can't show the string normally in gdb?

开发者 https://www.devze.com 2023-02-22 23:11 出处:网络
source: char *pid_file... gdb: (gdb) p (char *)pid_file $47 = 0x423047 \"H\\215\\005\\366i \" (gdb) x/s pid_file

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 ;-(

0

精彩评论

暂无评论...
验证码 换一张
取 消