public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [DWARF5] Is debug_line.dwo parsing and handling correct in GDB
@ 2021-06-17  7:57 Tomar, Sourabh Singh
  2021-06-22 20:52 ` David Blaikie
  0 siblings, 1 reply; 2+ messages in thread
From: Tomar, Sourabh Singh @ 2021-06-17  7:57 UTC (permalink / raw)
  To: gdb, paul.robinson, David Blaikie
  Cc: Achra, Nitika, George, Jini Susan, Sharma, Alok Kumar, Kumar N,
	Bhuvanendra, E, Nagajyothi

Hello Everyone,

Recently while investigating https://sourceware.org/bugzilla/show_bug.cgi?id=27966 I stumbled upon the
`.debug_line.dwo (AKA Specialized line table)` parsing part of the GDB.
Glancing over it, it seems like the parsing of the Specialized line table(.debug_line.dwo) is limited by the presence of type units.
However apart from type units there are other consumers of `.debug_line.dwo` such as `.debug_macro.dwo` for more context on this
front please refer to following DWARFIssue: http://dwarfstd.org/ShowIssue.php?issue=200602.1

Coming back to present situation, the question I have is the `.debug_line.dwo` section consumptions is Okay in GDB? If so, Can somebody
provide a possible testing scenario. As of now trunk GCC((GCC) 12.0.0 20210514) does not produce type units.
Compilation tried:
$ tot-gcc -fdebug-types-section -g macro.c
$ tot-gcc -fdebug-types-section -gstrict-dwarf macro.c

If GDB consumption of `.debug_line.dwo` is Okay, then how is it managing the primary line table `.debug_line`(containing the address to line mapping) part ?
Does it parses the primary line table in a subsequent pass ? or the primary line table is parsed first then a second pass needed to accommodate information
available in Specialized line table ?

Please note: CLANG emits Specialized line table iff macro + split mode are enabled i.e
```
$ clang -gdwarf-5 -gsplit-dwarf  -fdebug_macro macro.c
$ llvm-readelf -S macro.dwo | egrep "debug"
  [ 2] .debug_macro.dwo  PROGBITS        0000000000000000 000040 0004f2 00   E  0   0  1
  [ 3] .debug_str_offsets.dwo PROGBITS   0000000000000000 000532 000580 00   E  0   0  1
  [ 4] .debug_str.dwo    PROGBITS        0000000000000000 000ab2 002275 01 MSE  0   0  1
  [ 5] .debug_info.dwo   PROGBITS        0000000000000000 002d27 00003e 00   E  0   0  1
  [ 6] .debug_abbrev.dwo PROGBITS        0000000000000000 002d65 00003f 00   E  0   0  1
  [ 7] .debug_line.dwo   PROGBITS        0000000000000000 002da4 000056 00   E  0   0  1
```

Any pointer, much appreciated!

Thanks,
Sourabh.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [DWARF5] Is debug_line.dwo parsing and handling correct in GDB
  2021-06-17  7:57 [DWARF5] Is debug_line.dwo parsing and handling correct in GDB Tomar, Sourabh Singh
@ 2021-06-22 20:52 ` David Blaikie
  0 siblings, 0 replies; 2+ messages in thread
From: David Blaikie @ 2021-06-22 20:52 UTC (permalink / raw)
  To: Tomar, Sourabh Singh
  Cc: gdb, paul.robinson, Achra, Nitika, George, Jini Susan, Sharma,
	Alok Kumar, Kumar N, Bhuvanendra, E, Nagajyothi

On Thu, Jun 17, 2021 at 12:57 AM Tomar, Sourabh Singh <
SourabhSingh.Tomar@amd.com> wrote:

> Hello Everyone,
>
>
>
> Recently while investigating
> https://sourceware.org/bugzilla/show_bug.cgi?id=27966 I stumbled upon the
>
> `.debug_line.dwo (AKA Specialized line table)` parsing part of the GDB.
>
> Glancing over it, it seems like the parsing of the Specialized line
> table(.debug_line.dwo) is limited by the presence of type units.
>
> However apart from type units there are other consumers of
> `.debug_line.dwo` such as `.debug_macro.dwo` for more context on this
>
> front please refer to following DWARFIssue:
> http://dwarfstd.org/ShowIssue.php?issue=200602.1
>
>
>
> Coming back to present situation, the question I have is the
> `.debug_line.dwo` section consumptions is Okay in GDB? If so, Can somebody
>
> provide a possible testing scenario. As of now trunk GCC((GCC) 12.0.0
> 20210514) does not produce type units.
>

For what it's worth: GCC does produce type units, at least so far as I know
- but what you might be hitting is that in DWARFv5 type units are in the
.debug_info[.dwo] section, not the .debug_types[.dwo] section - so the
absence of .debug_types section doesn't mean that type units aren't being
produced. (I don't have a tot gcc build - mine's a little older and doesn't
have some of the recent DWARFv5 work, I guess)

I can't speak for GDB's handling of .debug_line.dwo, though.


> Compilation tried:
>
> $ tot-gcc -fdebug-types-section -g macro.c
>
> $ tot-gcc -fdebug-types-section -gstrict-dwarf macro.c
>
>
>
> If GDB consumption of `.debug_line.dwo` is Okay, then how is it managing
> the primary line table `.debug_line`(containing the address to line
> mapping) part ?
>
> Does it parses the primary line table in a subsequent pass ? or the
> primary line table is parsed first then a second pass needed to accommodate
> information
>
> available in Specialized line table ?
>
>
>
> Please note: CLANG emits Specialized line table iff macro + split mode are
> enabled i.e
>
> ```
>
> $ clang -gdwarf-5 -gsplit-dwarf  -fdebug_macro macro.c
>
> $ llvm-readelf -S macro.dwo | egrep "debug"
>
> *  [ 2] .debug_macro.dwo  PROGBITS        0000000000000000 000040 0004f2
> 00   E  0   0  1*
>
>   [ 3] .debug_str_offsets.dwo PROGBITS   0000000000000000 000532 000580
> 00   E  0   0  1
>
>   [ 4] .debug_str.dwo    PROGBITS        0000000000000000 000ab2 002275 01
> MSE  0   0  1
>
>   [ 5] .debug_info.dwo   PROGBITS        0000000000000000 002d27 00003e
> 00   E  0   0  1
>
>   [ 6] .debug_abbrev.dwo PROGBITS        0000000000000000 002d65 00003f
> 00   E  0   0  1
>
> *  [ 7] .debug_line.dwo   PROGBITS        0000000000000000 002da4 000056
> 00   E  0   0  1*
>
> ```
>
>
>
> Any pointer, much appreciated!
>
>
>
> Thanks,
>
> Sourabh.
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-22 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  7:57 [DWARF5] Is debug_line.dwo parsing and handling correct in GDB Tomar, Sourabh Singh
2021-06-22 20:52 ` David Blaikie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).