设为首页收藏本站
查看: 9562|回复: 0

如何查看编译后Image是否包含调试信息?

[复制链接]

231

主题

64

回帖

2145

积分

管理员

积分
2145
玉米糊 发表于 2015-6-17 15:39:44 | 显示全部楼层 |阅读模式
方法一,查看编译选项
有Makefile可以看Makefile,如果编译选项中包含“-g”,说明编译后是包含调试信息的。如U-Boot可通过根目录下的config.mk文件,DBGFLAGS是否赋值
[mw_shl_code=bash,true]DBGFLAGS= -g[/mw_shl_code]其中DBGFLAGS最后是赋值给CFLAGS。

方法二,命令查看
如要查看u-boot镜像是否包含调试信息,可用命令:
[mw_shl_code=bash,true]readelf –S u-boot | grep  "debug"[/mw_shl_code]
如果输出如下多行,说明包含调试信息:
[mw_shl_code=bash,true]  [27] .debug_aranges    PROGBITS        00000000 00191b 000020 00      0   0  1
  [28] .debug_info       PROGBITS        00000000 00193b 00060a 00      0   0  1
  [29] .debug_abbrev     PROGBITS        00000000 001f45 000148 00      0   0  1
  [30] .debug_line       PROGBITS        00000000 00208d 000296 00      0   0  1
  [31] .debug_frame      PROGBITS        00000000 002324 00011c 00      0   0  4
  [32] .debug_str        PROGBITS        00000000 002440 0002c0 01  MS  0   0  1
  [33] .debug_loc        PROGBITS        00000000 002700 000134 00      0   0  1[/mw_shl_code]
其中,可调试镜像必须包含有.debug_info和.debug_line。





回复

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-4-26 11:57 , Processed in 0.049263 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表