gdb + nasm调试信息未被创建 [英] gdb + nasm debug info not being created
问题描述
我正在编译我的程序如下。
nasm -f elf -g -F dwarf bs.asm
gcc -m32 -g bs.o -o bs
当我运行
gdb bs
我收到一条消息,表示没有调试符号,当我尝试通过
设置断点 b main
它表示功能没有定义,即使它在文件中,我可以使用./bs
几个帖子,建议在组装时添加-F矮人,但是如果有任何人有任何见解,则不会有任何帮助。我将非常感谢您的输入。
使用以下命令组合文件: -
nasm -f elf -F dwarf -g file.asm
ld -m elf_i386 -o file file.o
然后使用gdb,
I am relatively new to assembly language programming and am trying to debug a small .asm file that I wrote in Ubuntu. I am however running into an issue where my symbol table is not being loaded and was looking for some help.
I am compiling my program as follows.
nasm -f elf -g -F dwarf bs.asm
gcc -m32 -g bs.o -o bs
which produces the executable bs when I run
gdb bs
I get a message that says no debugging symbols and when I try to set a break point by
b main
it says function not defined even though its in the file and I can run it using ./bs
I read a couple posts that suggested adding the -F dwarf when assembling but that didn't help if anyone has any insight I would greatly appreciated your input.
Assemble your file with the following commands :-
nasm -f elf -F dwarf -g file.asm
ld -m elf_i386 -o file file.o
and then use gdb,
这篇关于gdb + nasm调试信息未被创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!