问题
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
- Debug Build
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