gdb + nasm调试信息未被创建 [英] gdb + nasm debug info not being created

查看:148
本文介绍了gdb + nasm调试信息未被创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我比较新的汇编语言编程,我试图调试我在Ubuntu中编写的一个小的.asm文件。我遇到一个问题,我的符号表没有加载,并且正在寻找一些帮助。



我正在编译我的程序如下。

  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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆