如何判断一个.o文件是否有gdb信息
假设有一个文件a.c
我可以这么编译:gcc -o a.o -c a.c
也可以这么编译:gcc -o a.o -c a.c -g
请问我如何根据已有的a.o判断到底是上面两种中哪一种方式编译的?
[解决办法]
用如下命令:
objdump -t a.o
00000000 l d .debug_aranges00000000 .debug_aranges
00000000 l d .debug_pubnames00000000 .debug_pubnames
00000000 l d .debug_info00000000 .debug_info
00000000 l d .debug_abbrev00000000 .debug_abbrev
00000000 l d .debug_line00000000 .debug_line
00000000 l d .debug_frame00000000 .debug_frame
00000000 l d .debug_str00000000 .debug_str
00000000 l d .debug_loc00000000 .debug_loc