Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 GDB 中,我正在尝试:
gdb> p/s *0x0804b680
这给了我:
$6 = 0x6c627550
显然它应该打印出来lbruP,还是我错了?
lbruP
对于 char* p = "abcde";
做
p /s p
例如不是 *p
(gdb) p /s p $9 = 0x40060c "abcde"
如果您的 p 不是 char* 类型(例如 void* v = p ),您可以强制转换它或使用 x 命令
(gdb) p /s (char*)v $7 = 0x40061c "abcde" (gdb) x /s v 0x40061c: "abcde"