문제

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.

도움이 되었습니까?

해결책

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).

다른 팁

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

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top