GDB complains No Source Available

后端 未结 2 1642
猫巷女王i
猫巷女王i 2021-02-14 17:14

I\'m running on Ubuntu 12.10 64bit.

I am trying to debug a simple assembly program in GDB. However GDB\'s gui mode (-tui) seems unable to find the source code of my asse

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 17:41

    The problem in this case is that the assembler isn't producing line-number information for the debugger. So although the source is there (if you do "list" in gdb, it shows a listing of the source file - at least when I follow your steps, it does), but the debugger needs line-number information from the file to know what line corresponds to what address. It can't do that with the information given.

    As far as I can find, there isn't a way to get NASM to issue the .loc directive that is used by as when using gcc for example. But as isn't able to take your source file without generating a gazillion errors [even with -msyntax=intel -mmnemonic=intel -- you would think that should work].

    So unless someone more clever can come up with a way to generate the .loc entries which gives the debugger line number information, I'm not entirely sure how we can answer your question in a way that you'll be happy with.

提交回复
热议问题