gdb
gdb

Reputation: 7789

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?

Upvotes: 0

Views: 165

Answers (1)

Employed Russian
Employed Russian

Reputation: 213516

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

Upvotes: 1

Related Questions