【问题标题】:Cygwin EMacs GDB cannot debug NASM-64 sourceCygwin EMacs GDB 无法调试 NASM-64 源
【发布时间】:2018-02-20 20:41:44
【问题描述】:

我有一个编写为控制台应用程序的 64 位 NASM exe。我想在 Cygwin 下的 Emacs 中使用 gdb 对其进行调试。我使用以下命令字符串编译和组装:

nasm -f elf64 Prime_Number_EXE.asm 
gcc -g -l cygwin Prime_Number_EXE.o -o Prime_Number_EXE.exe

编译链接后,我去cygwin启动emacs。我打开 nasm 源文件。然后我启动 gdb 并切换到 gdb-many-windows 模式。但是源窗口中显示的源文件不是我的 nasm 代码;这是 Cygwin 插入的一个特殊的 C 程序,上面写着

/* libcmain.c
This file is part of Cygwin.
/* Allow apps which don't have a main to work, as long as they define WinMain */

所以它不会显示 nasm 源代码,并且当我单步执行它时,它不会在 nasm 源代码中的任何断点处停止。

我该如何解决这个问题?

感谢您的帮助。

【问题讨论】:

    标签: emacs gdb cygwin nasm


    【解决方案1】:

    elf64 不是 COFF 的 windows/cygwin 程序的结构, 你不能在 windows 上运行 elf64。

    您正在查看添加到所有程序中的 STUB gcc。 对于你想要做的事情,你需要一个 Unix/Linux 系统或 改为COFF结构。

    【讨论】:

      猜你喜欢
      • 2011-11-19
      • 1970-01-01
      • 2011-06-23
      • 2012-05-27
      • 2012-09-08
      • 1970-01-01
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      相关资源
      最近更新 更多