我在用GDB调试的时候遇到一个小问题。
问题是这样的:
当我想获取“main”的地址时,我可以这样做
gdb-peda$ p main
$1 = {<text variable, no debug info>} 0x400b21 <main>
gdb-peda$ x main
0x400b21 <main>: 0x000000b8e5894855
但是如果我想获取'的地址[电子邮件受保护] /cdn-cgi/l/email-protection', 它成为了
gdb-peda$ x [email protected] /cdn-cgi/l/email-protection
No symbol table is loaded. Use the "file" command.
gdb-peda$ p p[email protected] /cdn-cgi/l/email-protection
No symbol table is loaded. Use the "file" command.
And '[电子邮件受保护] /cdn-cgi/l/email-protection'实际上存在。
gdb-peda$ x 0x602020
0x602020 <[email protected] /cdn-cgi/l/email-protection>: 0x00000000004006e6
我想我必须转义“@”和“.”使得信息‘[电子邮件受保护] /cdn-cgi/l/email-protection' 可以成功打印出来,但我不知道该怎么做。谁能帮我?
------ 2020/05/03 已编辑 ------
谢谢@JohnKoch,我试过了x &'[email protected] /cdn-cgi/l/email-protection'
, 有用。
虽然我不明白为什么它不只打印内容'[email protected] /cdn-cgi/l/email-protection'
使用时x '[email protected] /cdn-cgi/l/email-protection'
,这样我需要添加&
......
gdb-peda$ x/4gx '[email protected] /cdn-cgi/l/email-protection'
0x7ffff7a649c0 <_IO_puts>: 0x55fc894954415541 0x072ee808ec834853
0x7ffff7a649d0 <_IO_puts+16>: 0x36be6f2d8b48fffa 0x4800458bc3894800
Add &
:
gdb-peda$ x/4gx &'[email protected] /cdn-cgi/l/email-protection'
0x602020 <[email protected] /cdn-cgi/l/email-protection>: 0x00007ffff7a649c0 0x00000000004006f6
0x602030 <prin[email protected] /cdn-cgi/l/email-protection>: 0x0000000000400706 0x0000000000400716