您的位置:首页 > 其它

GDB进行汇编级的调试

2013-08-04 15:34 316 查看
gcc -S test.c

生成test.s文件

as -o test.o -gstabs test.s

生成test.o文件

gcc -o test -Wall test.o


gdb test

以下为man as得到到信息

--gen-debug

           Generate debugging information for each assembler source

           line using whichever debug format is preferred by the

           target.  This currently means either STABS, ECOFF or

           DWARF2.

       --gstabs

           Generate stabs debugging information for each assembler

           line.  This may help debugging assembler code, if the

           debugger can handle it.

       --gstabs+

           Generate stabs debugging information for each assembler

           line, with GNU extensions that probably only gdb can

           handle, and that could make other debuggers crash or

           refuse to read your program.  This may help debugging

           assembler code.  Currently the only GNU extension is the

           location of the current working directory at assembling

           time.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: