debugging - Emacs gdb - 调试程序集时显示箭头

标签 debugging assembly emacs gdb

我正在尝试使用 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 中看到的是那个。在此屏幕截图中,我当前正在断点之后执行该行,并且没有出现指向该行的指针。有可能拥有一个吗?
screenshot

最佳答案

首先,我希望你是仍然寻找解决方案,已经2年了!如果是,请尝试哄骗 nasm 以使用 DWARF 而不是 STAB 生成调试信息,即以下内容

nasm -f elf -g -F dwarf eatsyscall.asm ...

这似乎对我有用(TM)

关于debugging - Emacs gdb - 调试程序集时显示箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11086323/

相关文章:

python - 无法使用Python调用GDB用户定义的函数

python - Django-Debug-Toolbar 没有显示

c - 如何确定堆栈中保存的值?

macos - 如何在 OS X 上正确安装 emacs?

emacs - 为什么我的 emacs comint 缓冲区有时似乎共享相同的历史记录?

ios - iOS游戏开始时的输入延迟

C 代码陷入无限的 do-while 循环

assembly - 如何链接我的 nasm 程序来访问 argc?

linux - 比较字符与 Intel x86_64 汇编

linux - 创建在后台启动的 emacs 别名?