|
Home > Archive > Unix Programming > May 2007 > REG .debug section in elf
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
REG .debug section in elf
|
|
| fazlin 2007-05-21, 1:19 pm |
| Hi all,
Can anyone explian me in detail about the purpose and format of .debug
section in elf??
Thanks in advance,
Fazlin
| |
| Pietro Cerutti 2007-05-21, 1:19 pm |
| fazlin wrote:
> Hi all,
>
> Can anyone explian me in detail about the purpose and format of .debug
> section in elf??
..debug This section holds information for symbolic debugging. The
contents are unspecified. This section is of type
SHT_PROGBITS. No attribute types are used.
See http://www.freebsd.org/cgi/man.cgi?query=elf
>
> Thanks in advance,
> Fazlin
>
--
Pietro Cerutti
PGP Public Key:
http://gahr.ch/pgp
| |
| fazlin 2007-05-21, 1:19 pm |
| On May 21, 7:56 pm, Pietro Cerutti <g...@gahr.ch> wrote:
> fazlin wrote:
>
>
> .debug This section holds information for symbolic debugging. The
> contents are unspecified. This section is of type
> SHT_PROGBITS. No attribute types are used.
>
> Seehttp://www.freebsd.org/cgi/man.cgi?query=elf
>
>
>
>
> --
> Pietro Cerutti
>
> PGP Public Key:http://gahr.ch/pgp
Any help on how that section should be interpreted??
Anyway thanks for replyin..
Fazlin
| |
| Pietro Cerutti 2007-05-21, 1:19 pm |
| fazlin wrote:
> On May 21, 7:56 pm, Pietro Cerutti <g...@gahr.ch> wrote:
>
> Any help on how that section should be interpreted??
No, sorry...
The standard says the same ("The contents are unspecified"):
http://refspecs.freestandards.org/e...h4.sheader.html
>
> Anyway thanks for replyin..
>
> Fazlin
>
--
Pietro Cerutti
PGP Public Key:
http://gahr.ch/pgp
| |
| Doug McIntyre 2007-05-21, 1:19 pm |
| fazlin <fazlincse@gmail.com> writes:
>On May 21, 7:56 pm, Pietro Cerutti <g...@gahr.ch> wrote:
[vbcol=seagreen]
>Any help on how that section should be interpreted??
Its not standard, or generalized. Each compiler/enviornment is different.
Ie. Sun C Workshop gives out a bunch of sections..
.debug_info
.debug_line
.debug_abbrev
.debug_pubnames
.debug_typenames
.debug_varnames
GCC doesn't use .debug either, it uses .stab/.stabstr instead on some
platforms.
So, the .debug section contents would only be defined on the specific
enviornment/compiler you are looking at on a specific platform, and
you'd have to look at whatever documentation exists there to see inside.
| |
| Paul Pluzhnikov 2007-05-22, 1:18 am |
| Doug McIntyre <merlyn@geeks.org> writes:
> Its not standard, or generalized. Each compiler/enviornment is different.
Untrue. There are differences between compilers, but most of them
are slight variations of DWARF2 or DWARF3 debug format.
> Ie. Sun C Workshop gives out a bunch of sections..
> .debug_info
> .debug_line
> .debug_abbrev
> .debug_pubnames
> .debug_typenames
> .debug_varnames
See description of DWARF for what's inside.
> GCC doesn't use .debug either, it uses .stab/.stabstr instead on some
> platforms.
Gcc uses .stab* when it generates STABS debug info ('-gstabs',
'-gstabs+', etc.). Newer gcc releases default to DWARF3 on ELF
platforms:
$ /usr/local/gcc-4.2.0/bin/gcc -g junk.c -c
$ readelf -S junk.o | grep ' \.debug'
[ 2] .debug_abbrev PROGBITS 00000000 000123 000047 00 0 0 1
[ 3] .debug_info PROGBITS 00000000 00016a 00009d 00 0 0 1
[ 4] .debug_line PROGBITS 00000000 000207 000076 00 0 0 1
[ 6] .debug_frame PROGBITS 00000000 0002c8 000064 00 0 0 4
[ 7] .debug_loc PROGBITS 00000000 00032c 00005a 00 0 0 1
[ 8] .debug_pubnames PROGBITS 00000000 000386 00002b 00 0 0 1
[ 9] .debug_aranges PROGBITS 00000000 0003b1 000020 00 0 0 1
Use 'readelf -w' to decode DWARF .debug* info.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
|
|
|
|
|