GDB - 显示地址
GDB - Display Addresses
在 gdb 中查看的一段代码如下:
0x8e4e <boot1main+1>: mov %esp,%ebp
0x8e50 <boot1main+3>: push %esi
0x8e51 <boot1main+4>: mov 0xc(%ebp),%esi
0x8e54 <boot1main+7>: push %ebx
0x8e55 <boot1main+8>: mov 0x10(%ebp),%ebx
0x8e58 <boot1main+11>: sub [=10=]xc,%esp
0x8e5b <boot1main+14>: push [=10=]x3
0x8e5d <boot1main+16>: call 0x8bb6 <roll>
0x8e62 <boot1main+21>: movl [=10=]x8f84,(%esp)
0x8e69 <boot1main+28>: call 0x8b77 <putline>
左边地址的具体含义是什么?这些是组装说明在机器上的位置吗? (即 0x8e4e、0x8e50)。
上面的代码是在没有设置虚拟内存的情况下生成的。事实上,它代表了我正在跟踪的一些引导加载程序代码。
对于普通的C程序,左边的虚拟地址是那些地址吗?
是的,这就是您正在查看的代码的地址。是的,对于 "proper" OS 上的普通 C 程序,地址将是虚拟的。
在 gdb 中查看的一段代码如下:
0x8e4e <boot1main+1>: mov %esp,%ebp
0x8e50 <boot1main+3>: push %esi
0x8e51 <boot1main+4>: mov 0xc(%ebp),%esi
0x8e54 <boot1main+7>: push %ebx
0x8e55 <boot1main+8>: mov 0x10(%ebp),%ebx
0x8e58 <boot1main+11>: sub [=10=]xc,%esp
0x8e5b <boot1main+14>: push [=10=]x3
0x8e5d <boot1main+16>: call 0x8bb6 <roll>
0x8e62 <boot1main+21>: movl [=10=]x8f84,(%esp)
0x8e69 <boot1main+28>: call 0x8b77 <putline>
左边地址的具体含义是什么?这些是组装说明在机器上的位置吗? (即 0x8e4e、0x8e50)。
上面的代码是在没有设置虚拟内存的情况下生成的。事实上,它代表了我正在跟踪的一些引导加载程序代码。
对于普通的C程序,左边的虚拟地址是那些地址吗?
是的,这就是您正在查看的代码的地址。是的,对于 "proper" OS 上的普通 C 程序,地址将是虚拟的。