生成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.