如何协调GDB中的指令指针和当前行?
我有两个代码段:.multiboot.text 和 .text
它们在内存中的位置如下:
linker.ld
SECTIONS
{
. = 0x00100000;
/* The kernel will live at 3GB + 1MB in the virtual address space, */
/* which will be mapped to 1MB in the physical address space. */
_kernel_start = .;
.multiboot.text : {
*(.multiboot.text)
}
. += 0xC0000000;
/* Add a symbol that indicates the start address of the kernel. */
.text ALIGN (4K) : AT (ADDR (.text) - 0xC0000000)
{
*(.text)
}
}
start.asm
section .multiboot.text
. . .
; Jump to higher half with an absolute jump.
; <breakpoint is successfully triggered here>
; <single>
lea ecx, .higher_half
jmp ecx
section .text
.higher_half:
; Unmap the identity mapping as it is now unnecessary.
; <breakpoint doesn't work here>
mov [boot_page_directory + 0], DWORD 0
; Reload crc3 to force a TLB flush so the changes to take effect.
mov ecx, cr3
mov cr3, ecx
. . .
在我的 start.asm 文件中,我从 .multiboot.text 传递控制权段到 .text 并且 IP 从 0x001 更改???在 0xC01 上???并且调试器无法使此更改与当前行协调
因此,逐步调试对我不起作用
我该如何帮助他呢?
我使用 nasm 和 -g 标志编译 start.asm,这意味着存在调试信息
注意,代码本身物理上位于内存的下半部分,但是IP的这种差异是由于虚拟内存造成的
I have two code segments: .multiboot.text and .text
They are located in memory as follows:
linker.ld
SECTIONS
{
. = 0x00100000;
/* The kernel will live at 3GB + 1MB in the virtual address space, */
/* which will be mapped to 1MB in the physical address space. */
_kernel_start = .;
.multiboot.text : {
*(.multiboot.text)
}
. += 0xC0000000;
/* Add a symbol that indicates the start address of the kernel. */
.text ALIGN (4K) : AT (ADDR (.text) - 0xC0000000)
{
*(.text)
}
}
start.asm
section .multiboot.text
. . .
; Jump to higher half with an absolute jump.
; <breakpoint is successfully triggered here>
; <single>
lea ecx, .higher_half
jmp ecx
section .text
.higher_half:
; Unmap the identity mapping as it is now unnecessary.
; <breakpoint doesn't work here>
mov [boot_page_directory + 0], DWORD 0
; Reload crc3 to force a TLB flush so the changes to take effect.
mov ecx, cr3
mov cr3, ecx
. . .
In my start.asm file, I pass control from the .multiboot.text segment to the .text and IP changes from 0x001????? on 0xC01????? and the debugger cannot reconcile this change with the current line
As a result of this, step-by-step debugging does not work for me
How can I help him with this?
I compile start.asm using nasm and the -g flag, which means debugging information is present
Pay attention to the fact that the code itself is physically located in the lower half of memory, however, such a difference in IP is due to virtual memory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论