简体   繁体   English

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

[英]Emacs gdb - display arrow when debugging assembly

I'm trying to debug an assembly program using gdb and Emacs. 我正在尝试使用gdb和Emacs调试汇编程序。 My problem is that, when I try to debug step-by-step, it doesn't show a pointer arrow at the current executing line. 我的问题是,当我尝试逐步调试时,它不会在当前执行行显示指针箭头。 The code I'm trying to debug is: 我正在尝试调试的代码是:

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

and I'm compiling with these lines: 我正在编译这些行:

    nasm -f elf -g -F stabs eatsyscall.asm -l eatsyscall.lst
    ld -melf_i386 -o eatsyscall eatsyscall.o

What I see in Emacs is that. 我在Emacs中看到的是那个。 In this screenshot I'm currently executing the line after the breakpoint and no pointer to that line appears. 在这个截图中,我正在断点之后执行该行,并且没有指向该行的指针。 Is it possible to have one? 有可能有吗? 截图

first of all, i hope you are still looking for the solution, it has been 2 years ! 首先,我希望你还在寻找解决方案,已经有2年了! if you are, then try coaxing nasm to generate debugging information with DWARF instead of STAB ie the following 如果你是,那么尝试哄骗nasm用DWARF而不是STAB生成调试信息,即以下内容

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

that seems to work for me (TM) 这似乎适合我(TM)

尝试下载nasm2.5或最新的,它应该工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM