What is Debug Info?

和自甴很熟 提交于 2019-12-11 20:07:53

问题


I am an intermediate C programmer who is learning his way around. I recently learned using GDB (forced to actually) and also am doing some code using Ptrace.
I was browsing through some code on ptrace and came across "DEBUG INFO".

I want to know what this means and when should I include this in my code?
What are debug info files?

I couldnt find much from google and wiki related to this. There is no wiki for that tag too. May be if you can point me to the right direction I can repay by writing one.


回答1:


DEBUG_INFO you are referring to is probably just an option (and define) of linux kernel. Enabling it when configuring kernel tells compiler to include debug information in resulting binary. This debug information itself is just additional data, that allows debuggers (and other tools like strace, addr2line, gprof, ...) relate binary code it's executing to source it was compiled from (source lines, variable names, etc, etc). You can find more details on debug information in general starting at DWARF (popular debug data format).




回答2:


check for what is a core dump .you might get some directions.




回答3:


The whole credit goes to Peter for the answer. Initially I went through "What is core dump"
Then I came across the following link which actually tells the difference between

  1. Debug Build
  2. Release build

    which is: debug build includes debug information while a release built doesn't have these and is Optimized code. Also this answer can help you get more information.



来源:https://stackoverflow.com/questions/9919911/what-is-debug-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!