我在没有运气的情况下搜索其他线程。我的问题可能很简单但令人沮丧。我正在 64 位 Ubuntu 11.04 上编译两个文件:
nasm -f elf64 -g file64.asmgcc -g -o file file.c file64.o然后我用 gdb 调试生成的可执行文件。有了 C,一切都好了。但是,在调试程序集时,源代码对调试器“不可见”。我得到以下输出:
(gdb) step
Single stepping until exit from function line,
which has no line number information.
0x0000000000400962 in convert ()
Run Code Online (Sandbox Code Playgroud)
快速调查:
objdump --source file64.o
Run Code Online (Sandbox Code Playgroud)
显示汇编源代码(和行信息)包含在文件中。
为什么我在调试会话中看不到它?我究竟做错了什么?这些问题是在迁移到 64 位 Ubuntu 后出现的。在 32 位 Linux 中它可以工作(应该如此)。