public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/115066] New: [debug, gsplit-dwarf, gdwarf-4, g3] DW_MACRO_define_strp used for debug_str_offsets index
@ 2024-05-13  8:40 vries at gcc dot gnu.org
  2024-05-13  8:42 ` [Bug debug/115066] " vries at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2024-05-13  8:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115066

            Bug ID: 115066
           Summary: [debug, gsplit-dwarf, gdwarf-4, g3]
                    DW_MACRO_define_strp used for debug_str_offsets index
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider a hello world, compiled with split dwarf and dwarf version 4, and -g3
for macro info:
...
$ gcc -gdwarf-4 -gsplit-dwarf /data/vries/hello.c -g3 -save-temps -dA
...

In section .debug_macro.dwo, we have:
...
.Ldebug_macro0:
        .value  0x4     # DWARF macro version number
        .byte   0x2     # Flags: 32-bit, lineptr present
        .long   .Lskeleton_debug_line0
        .byte   0x3     # Start new file
        .uleb128 0      # Included from line number 0
        .uleb128 0x1    # file /data/vries/hello.c
        .byte   0x5     # Define macro strp
        .uleb128 0      # At line number 0
        .uleb128 0x1d0  # The macro: "__STDC__ 1"
...

So, given that we use a DW_MACRO_define_strp, we'd expect 0x1d0 to be an offset
into a .debug_str section.

However, in .debug_str.dwo we find:
...
  0x000001d0 455f584f 50454e32 4b385853 49005345 E_XOPEN2K8XSI.SE
...

In fact, 0x1d0 is an index into the string offset table in
.debug_str_offsets.dwo:
...
        .long   0x34f0  # indexed string 0x1d0: __STDC__ 1
...

So, it looks like DW_MACRO_define_strx should have been used instead.

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

end of thread, other threads:[~2024-05-27 14:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13  8:40 [Bug debug/115066] New: [debug, gsplit-dwarf, gdwarf-4, g3] DW_MACRO_define_strp used for debug_str_offsets index vries at gcc dot gnu.org
2024-05-13  8:42 ` [Bug debug/115066] " vries at gcc dot gnu.org
2024-05-13  9:12 ` vries at gcc dot gnu.org
2024-05-13 10:27 ` rguenth at gcc dot gnu.org
2024-05-13 10:29 ` vries at gcc dot gnu.org
2024-05-13 10:33 ` jakub at gcc dot gnu.org
2024-05-13 11:11 ` vries at gcc dot gnu.org
2024-05-14 11:35 ` vries at gcc dot gnu.org
2024-05-14 12:00 ` cvs-commit at gcc dot gnu.org
2024-05-14 12:04 ` vries at gcc dot gnu.org
2024-05-16  8:35 ` ro at gcc dot gnu.org
2024-05-16  9:06 ` vries at gcc dot gnu.org
2024-05-16  9:22 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-05-22  8:06 ` cvs-commit at gcc dot gnu.org
2024-05-27 14:02 ` clyon at gcc dot gnu.org

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