public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/30814] New: [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*("
@ 2023-08-31 10:37 vries at gcc dot gnu.org
  2023-08-31 10:39 ` [Bug symtab/30814] " vries at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-31 10:37 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30814
           Summary: [gdb/symtab, cc-with-dwz-m] FAIL:
                    gdb.cp/cplusfuncs.exp: info function for "operator\*("
           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: ---

With target board unix we get:
...
(gdb) info function operator\*(^M
All functions matching regular expression "operator\*(":^M
^M
File /data/vries/gdb/src/gdb/testsuite/gdb.cp/cplusfuncs.cc:^M
72:     void foo::operator*(foo&);^M
^M
Non-debugging symbols:^M
0x00007ffff7c22ae0  std::filesystem::directory_iterator::operator*()
const@plt^M
0x00007ffff7c23710  std::filesystem::__cxx11::directory_iterator::operator*()
const@plt^M
0x00007ffff7cf5f10  std::filesystem::__cxx11::directory_iterator::operator*()
const^M
0x00007ffff7cf5fa0 
std::filesystem::__cxx11::recursive_directory_iterator::operator*() const^M
0x00007ffff7d0c680  std::filesystem::directory_iterator::operator*() const^M
0x00007ffff7d0c710  std::filesystem::recursive_directory_iterator::operator*()
const^M
(gdb) PASS: gdb.cp/cplusfuncs.exp: info function for "operator\*("
...
but with target board cc-with-dwz-m:
...
(gdb) PASS: gdb.cp/cplusfuncs.exp: print &hairyfunc7
info function operator\*(^M
All functions matching regular expression "operator\*(":^M
^M
File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:^M
72:     void foo::operator*(foo&);^M
^M
Non-debugging symbols:^M
0x00007ffff7c22ae0  std::filesystem::directory_iterator::operator*()
const@plt^M
0x00007ffff7c23710  std::filesystem::__cxx11::directory_iterator::operator*()
const@plt^M
0x00007ffff7cf5f10  std::filesystem::__cxx11::directory_iterator::operator*()
const^M
0x00007ffff7cf5fa0 
std::filesystem::__cxx11::recursive_directory_iterator::operator*() const^M
0x00007ffff7d0c680  std::filesystem::directory_iterator::operator*() const^M
0x00007ffff7d0c710  std::filesystem::recursive_directory_iterator::operator*()
const^M
(gdb) FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*("
...

The problem is that the operator is listed under the wrong file name.  It
should be listed under:
...
File /data/vries/gdb/src/gdb/testsuite/gdb.cp/cplusfuncs.cc:^M
...
but instead it's listed under:
...
File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:^M
...

The DIE for the operator is:
...
 <2><de>: Abbrev Number: 25 (DW_TAG_subprogram)
    <df>   DW_AT_external    : 1
    <df>   DW_AT_name        : (indirect string, offset: 0x61): operator*
    <e3>   DW_AT_decl_file   : 2
    <e4>   DW_AT_decl_line   : 10
    <e5>   DW_AT_linkage_name: (indirect string, offset: 0x54c): _ZN3foomlERS_
    <e9>   DW_AT_accessibility: 1       (public)
    <ea>   DW_AT_declaration : 1
    <ea>   DW_AT_object_pointer: <0xee>
    <ec>   DW_AT_sibling     : <0xf5>
...
which is part of this CU:
...
 <0><4e>: Abbrev Number: 24 (DW_TAG_partial_unit)
    <4f>   DW_AT_stmt_list   : 0x0
...
which is part file .tmp/cplusfuncs.dwz, so the DW_AT_stmt_list 0x0 corresponds
to this file name table:
...
 The File Name Table (offset 0x64):
  Entry Dir     Time    Size    Name
  1     1       0       0       stddef.h
  2     2       0       0       cplusfuncs.cc
  3     0       0       0       elf-init.c
...
where selecting entry 2 gives us the correct filename.

What seems to be the problem is that instead, entry 2 is picked from the file
name table at 0xe9:
...
 The File Name Table (offset 0x159):
  Entry Dir     Time    Size    Name
  1     1       0       0       cplusfuncs.cc
  2     2       0       0       stddef.h
...
which is the one corresponding to the CU that imports the PU:
...
 <0><af>: Abbrev Number: 11 (DW_TAG_compile_unit)
    <b5>   DW_AT_name        : cplusfuncs.cc
    <c7>   DW_AT_stmt_list   : 0xe9
 <1><d5>: Abbrev Number: 5 (DW_TAG_imported_unit)
    <d6>   DW_AT_import      : <alt 0x4e>
...

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

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

* [Bug symtab/30814] [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*("
  2023-08-31 10:37 [Bug symtab/30814] New: [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*(" vries at gcc dot gnu.org
@ 2023-08-31 10:39 ` vries at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-31 10:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Looks similar to PR25771.

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

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

end of thread, other threads:[~2023-08-31 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 10:37 [Bug symtab/30814] New: [gdb/symtab, cc-with-dwz-m] FAIL: gdb.cp/cplusfuncs.exp: info function for "operator\*(" vries at gcc dot gnu.org
2023-08-31 10:39 ` [Bug symtab/30814] " 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).