hstk30 / hstk30.github.io

hstk30's Blog
Apache License 2.0
0 stars 0 forks source link

debug format STABS DWARF #20

Open hstk30-hw opened 2 months ago

hstk30-hw commented 2 months ago
hstk30-hw commented 2 months ago

debug 信息太大, -g 后二进制过大,导致 binutils 工具跑不了 file not recognize...

避免方法:

  1. Cmake 中只在需要调试的组件中加 -g
  2. 压缩,链接器选项 --compress-debug-sections=zlib 对 debug 信息进行压缩
  3. 使用 objcopy 工具操作指定段
  4. ... https://docs.saucelabs.com/error-reporting/advanced/dwarf/