public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/25953] New: [debug-names] Support multiple per-CU indices
@ 2020-05-08 16:04 vries at gcc dot gnu.org
  2020-05-08 16:07 ` [Bug symtab/25953] " vries at gcc dot gnu.org
  2023-12-10 15:35 ` tromey at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-08 16:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25953

            Bug ID: 25953
           Summary: [debug-names] Support multiple per-CU indices
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider the following two-file test-case:
...
$ cat main.c
extern void foo (void);

int
main (void)
{
  foo ();
  return 0;
}
$ cat foo.c
void
foo (void)
{
}
...

Compiled like this:
...
$ clang-10 main.c foo.c -gdwarf-5 -gpubnames
...

When running the exec with gdb, we have:
...
$ gdb -batch a.out

warning: Section .debug_names in /data/gdb_versions/devel/a.out length 112 does
not match section length 192, ignoring .debug_names.
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/25953] [debug-names] Support multiple per-CU indices
  2020-05-08 16:04 [Bug symtab/25953] New: [debug-names] Support multiple per-CU indices vries at gcc dot gnu.org
@ 2020-05-08 16:07 ` vries at gcc dot gnu.org
  2023-12-10 15:35 ` tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-08 16:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25953

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
The section contains two per-CU indices:
...
$ llvm-dwarfdump --all a.out
  ...
.debug_names contents:
Name Index @ 0x0 {
  Header {
    Length: 0x6C
    Version: 5
    Padding: 0x0
    CU count: 1
    Local TU count: 0
    Foreign TU count: 0
    Bucket count: 2
    Name count: 2
    Abbreviations table size: 0xD
    Augmentation: 'LLVM0700'
  }
  Compilation Unit offsets [
    CU[0]: 0x000000c7
  ]
  Abbreviations [
    Abbreviation 0x2e {
      Tag: DW_TAG_subprogram
      DW_IDX_die_offset: DW_FORM_ref4
    }
    Abbreviation 0x24 {
      Tag: DW_TAG_base_type
      DW_IDX_die_offset: DW_FORM_ref4
    }
  ]
  Bucket 0 [
    Name 1 {
      Hash: 0xB888030
      String: 0x00000061 "int"
      Entry @ 0x5d {
        Abbrev: 0x24
        Tag: DW_TAG_base_type
        DW_IDX_die_offset: 0x00000032
      }
    }
    Name 2 {
      Hash: 0x7C9A7F6A
      String: 0x0000020c "main"
      Entry @ 0x66 {
        Abbrev: 0x2E
        Tag: DW_TAG_subprogram
        DW_IDX_die_offset: 0x00000023
      }
    }
  ]
  Bucket 1 [
    EMPTY
  ]
}
Name Index @ 0x70 {
  Header {
    Length: 0x4C
    Version: 5
    Padding: 0x0
    CU count: 1
    Local TU count: 0
    Foreign TU count: 0
    Bucket count: 1
    Name count: 1
    Abbreviations table size: 0x7
    Augmentation: 'LLVM0700'
  }
  Compilation Unit offsets [
    CU[0]: 0x000000fe
  ]
  Abbreviations [
    Abbreviation 0x2e {
      Tag: DW_TAG_subprogram
      DW_IDX_die_offset: DW_FORM_ref4
    }
  ]
  Bucket 0 [
    Name 1 {
      Hash: 0xB887389
      String: 0x00000217 "foo"
      Entry @ 0xb7 {
        Abbrev: 0x2E
        Tag: DW_TAG_subprogram
        DW_IDX_die_offset: 0x00000023
      }
    }
  ]
}
...

But gdb expects a single per-module index.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/25953] [debug-names] Support multiple per-CU indices
  2020-05-08 16:04 [Bug symtab/25953] New: [debug-names] Support multiple per-CU indices vries at gcc dot gnu.org
  2020-05-08 16:07 ` [Bug symtab/25953] " vries at gcc dot gnu.org
@ 2023-12-10 15:35 ` tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2023-12-10 15:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25953

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
FWIW the new .debug_names reader is going to producer-sniff
and ignore non-gdb indices.  The reason for this is that both
old-style gdb and clang produce incorrect ones.

So while this is a bug, we won't need to fix it until there
is some producer that creates indices like this that we think
are correct enough to be read.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2023-12-10 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 16:04 [Bug symtab/25953] New: [debug-names] Support multiple per-CU indices vries at gcc dot gnu.org
2020-05-08 16:07 ` [Bug symtab/25953] " vries at gcc dot gnu.org
2023-12-10 15:35 ` tromey at sourceware dot 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).