【问题标题】:Emacs gdb - display arrow when debugging assemblyEmacs gdb - 调试程序集时显示箭头
【发布时间】:2012-06-18 15:43:58
【问题描述】:

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

【问题讨论】:

    标签: debugging assembly emacs gdb


    【解决方案1】:

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

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

    这似乎对我有用 (TM)

    【讨论】:

      【解决方案2】:

      尝试下载 nasm2.5 或可用的最新版本,它应该可以工作

      【讨论】:

      • 我也有同样的问题。我使用 Emacs 24 并拥有最新的稳定 NASM 版本。我只是看不到那个箭头......我也用你用 -g 做的同样的方式编译,但什么也没有。
      猜你喜欢
      • 2016-12-12
      • 1970-01-01
      • 2015-09-15
      • 2011-06-23
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多