public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/25700] New: Forward-imported CU causes duplicate partial symtab
@ 2020-03-19 13:36 vries at gcc dot gnu.org
  2020-03-19 13:37 ` [Bug gdb/25700] " vries at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: vries at gcc dot gnu.org @ 2020-03-19 13:36 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 25700
           Summary: Forward-imported CU causes duplicate partial symtab
           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 executable generated for test-case gdb.dwarf2/imported-unit.exp.

When loading the executable using various tracing:
...
$ gdb \
  outputs/gdb.dwarf2/imported-unit/imported-unit \
  -batch \
  -iex "set verbose on" \
  -iex "set debug symtab-create 1"                                 
Reading symbols from outputs/gdb.dwarf2/imported-unit/imported-unit...
Reading minimal symbols of objfile imported-unit ...
Installing 30 minimal symbols of objfile imported-unit.
Done reading minimal symbols.
Creating one or more psymtabs for objfile imported-unit ...
Created psymtab 0x2122960 for module ../sysdeps/x86_64/start.S.
Created psymtab 0x21569f0 for module init.c.
Created psymtab 0x213d620 for module ../sysdeps/x86_64/crti.S.
Created psymtab 0x213f380 for module <artificial>@0xc7.
Created psymtab 0x20e7b00 for module imported_unit.c.
Created psymtab 0x215da20 for module imported_unit.c.
Created psymtab 0x2133630 for module elf-init.c.
Created psymtab 0x215b910 for module ../sysdeps/x86_64/crtn.S.
Reading in symbols for <artificial>@0xc7...
Created compunit symtab 0x20d6f70 for <artificial>.
Created compunit symtab 0x2177490 for imported_unit.c.
...
we notice that there are two psymtabs generated for imported_unit.c.

This seems to be related to the fact that CU <artificial> imports CU
imported_unit.c, and that the import is a forward reference.

After reversing the order of two CUs, such that the import is a backward
reference, we have instead:
...
Reading symbols from outputs/gdb.dwarf2/imported-unit/imported-unit...
Reading minimal symbols of objfile imported-unit ...
Installing 30 minimal symbols of objfile imported-unit.
Done reading minimal symbols.
Creating one or more psymtabs for objfile imported-unit ...
Created psymtab 0x217d410 for module ../sysdeps/x86_64/start.S.
Created psymtab 0x21d84a0 for module init.c.
Created psymtab 0x21419e0 for module ../sysdeps/x86_64/crti.S.
Created psymtab 0x21dc190 for module imported_unit.c.
Created psymtab 0x21c6fa0 for module <artificial>@0x124.
Created psymtab 0x2195e30 for module elf-init.c.
Created psymtab 0x21c2c00 for module ../sysdeps/x86_64/crtn.S.
Reading in symbols for <artificial>@0x124...
Created compunit symtab 0x214f0f0 for <artificial>.
Created compunit symtab 0x21dd6d0 for imported_unit.c.
...

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

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

end of thread, other threads:[~2020-04-22  6:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 13:36 [Bug gdb/25700] New: Forward-imported CU causes duplicate partial symtab vries at gcc dot gnu.org
2020-03-19 13:37 ` [Bug gdb/25700] " vries at gcc dot gnu.org
2020-03-19 13:58 ` vries at gcc dot gnu.org
2020-03-19 14:06 ` vries at gcc dot gnu.org
2020-03-20 13:55 ` [Bug symtab/25700] " vries at gcc dot gnu.org
2020-03-24 13:01 ` vries at gcc dot gnu.org
2020-03-24 13:05 ` vries at gcc dot gnu.org
2020-03-24 13:36 ` vries at gcc dot gnu.org
2020-03-24 14:17 ` vries at gcc dot gnu.org
2020-03-27 12:50 ` vries at gcc dot gnu.org
2020-03-31 10:17 ` cvs-commit at gcc dot gnu.org
2020-04-08 10:20 ` vries at gcc dot gnu.org
2020-04-22  6:09 ` cvs-commit at gcc dot gnu.org
2020-04-22  6:11 ` 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).