public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26032] New: ggnu-pubnames gold gdb-index failure
@ 2020-05-24  9:08 vries at gcc dot gnu.org
  2020-05-25 13:52 ` [Bug gdb/26032] " vries at gcc dot gnu.org
  2020-05-25 14:30 ` vries at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-24  9:08 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26032
           Summary: ggnu-pubnames gold gdb-index failure
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider the following target board:
...
$ cat gdb/testsuite/boards/gnu-pubnames-gold-gdb-index.exp 

load_board_description "local-board"

# This is based on baseboards/unix.exp.
# At the moment we only support systems that unix.exp supports.
load_generic_config "unix"
process_multilib_options ""
set found_gcc [find_gcc]
set found_gxx [find_g++]
set found_gnatmake [find_gnatmake]
set found_f90 [find_gfortran]
set found_f77 [find_g77]
set_board_info compiler "$found_gcc"

set_board_info debug_flags \
    [join { "-g" \
                "-ggnu-pubnames" \
                "-Wl,--gdb-index" \
                "-fuse-ld=gold" }]
...

We see the following FAILs:
...
FAIL: gdb.base/c-linkage-name.exp: print symada__cS before partial symtab
expansion
FAIL: gdb.cp/subtypes.exp: ptype Outer::Inner::InnerInner
FAIL: gdb.cp/subtypes.exp: ptype Outer::Inner
...

-- 
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 gdb/26032] ggnu-pubnames gold gdb-index failure
  2020-05-24  9:08 [Bug gdb/26032] New: ggnu-pubnames gold gdb-index failure vries at gcc dot gnu.org
@ 2020-05-25 13:52 ` vries at gcc dot gnu.org
  2020-05-25 14:30 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-25 13:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> FAIL: gdb.cp/subtypes.exp: ptype Outer::Inner::InnerInner
> FAIL: gdb.cp/subtypes.exp: ptype Outer::Inner

So, with target board gold-gdb-index, we have:
...
$ readelf -w outputs/gdb.cp/subtypes/subtypes | grep Outer::Inner
[401] Outer::Inner::doit: 4 [global, function]
...

but with target board cc-with-gdb-index:
...
$ readelf -w outputs/gdb.cp/subtypes/subtypes | grep Outer::Inner
[275] Outer::Inner::InnerInner: 4 [global, type]
[363] Outer::Inner: 4 [global, type]
[401] Outer::Inner::doit: 4 [global, function]
...

So, when the index doesn't point us to CU 4 (which is the one for
subtypes-2.cc), we get the one for subtypes.cc (where Inner is a declaration).

-- 
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 gdb/26032] ggnu-pubnames gold gdb-index failure
  2020-05-24  9:08 [Bug gdb/26032] New: ggnu-pubnames gold gdb-index failure vries at gcc dot gnu.org
  2020-05-25 13:52 ` [Bug gdb/26032] " vries at gcc dot gnu.org
@ 2020-05-25 14:30 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-25 14:30 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> FAIL: gdb.base/c-linkage-name.exp: print symada__cS before partial symtab
> expansion

So, with target board gold-gdb-index, we have:
...
[753] mundane: 4 [global, variable]
...
but with target board cc-with-gdb-index:
...
[ 59] symada__cS: 4 [global, variable]
...

It seems there's disagreement whether the linkage name should be used or not:
...
 <1><164>: Abbrev Number: 5 (DW_TAG_variable)
    <165>   DW_AT_name        : (indirect string, offset: 0x32f): mundane
    <169>   DW_AT_decl_file   : 1
    <16a>   DW_AT_decl_line   : 31
    <16b>   DW_AT_linkage_name: (indirect string, offset: 0x355): symada__cS
    <16f>   DW_AT_type        : <0x146>
    <173>   DW_AT_external    : 1
    <173>   DW_AT_location    : 9 byte block: 3 10 20 40 0 0 0 0 0     
(DW_OP_addr: 402010)
...

And it's not gold, but gcc that chooses the "mundane" name:
...
        .section        .debug_gnu_pubnames,"",@progbits
        .long   0x48    # Pub Info Length
        .value  0x2     # DWARF Version
        .long   .Ldebug_info0   # Offset of Compilation Unit Info
        .long   0xae    # Compilation Unit Length
        .long   0x4b    # DIE offset
        .byte   0x20    # GDB-index flags
        .ascii "mundane\0"      # external name
        .long   0x64    # DIE offset
        .byte   0x30    # GDB-index flags
...
[Although, if we drop the -ggnu-pubnames, gold seems to make the same choice on
its own. ]

-- 
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:[~2020-05-25 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24  9:08 [Bug gdb/26032] New: ggnu-pubnames gold gdb-index failure vries at gcc dot gnu.org
2020-05-25 13:52 ` [Bug gdb/26032] " vries at gcc dot gnu.org
2020-05-25 14:30 ` vries 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).