我正在尝试使用 gdb 和 Emacs 调试汇编程序。我的问题是,当我尝试逐步调试时,它不会在当前执行行显示指针箭头。我试图调试的代码是:
SECTION .data ; Section containing initialised data
EatMsg: db "Eat at Joe's!",10
EatLen: equ $-EatMsg
SECTION .bss ; Section containing uninitialized data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
nop ; This no-op keeps gdb happy...
mov eax,4 ; Specify sys_write call
mov ebx,1 ; Specify File Descriptor 1: Standard Output
mov ecx,EatMsg ; Pass offset of the message
mov edx,EatLen ; Pass the length of the message
int 80H ; Make kernel call
MOV eax,1 ; Code for Exit Syscall
mov ebx,0 ; Return a code of zero
int 80H ; Make kernel call
我正在编译这些行:
nasm -f elf -g -F stabs eatsyscall.asm -l eatsyscall.lst
ld -melf_i386 -o eatsyscall eatsyscall.o
我在 Emacs 中看到的是那个。在此屏幕截图中,我当前正在断点之后执行该行,并且没有出现指向该行的指针。有可能拥有一个吗?
最佳答案
首先,我希望你是仍然寻找解决方案,已经2年了!如果是,请尝试哄骗 nasm 以使用 DWARF 而不是 STAB 生成调试信息,即以下内容
nasm -f elf -g -F dwarf eatsyscall.asm ...
这似乎对我有用(TM)
关于debugging - Emacs gdb - 调试程序集时显示箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11086323/