public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug go/30941] New: [gdb/go] cannot find package2.Foo in expanded symtab containing go.package2.Foo Date: Thu, 05 Oct 2023 12:28:13 +0000 [thread overview] Message-ID: <bug-30941-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=30941 Bug ID: 30941 Summary: [gdb/go] cannot find package2.Foo in expanded symtab containing go.package2.Foo Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: go Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- While investigating PR27238, I found that when not generating dwarf info: ... $ gccgo-7 ./src/gdb/testsuite/gdb.go/package2.go -c -g0 $ gccgo-7 ./src/gdb/testsuite/gdb.go/package1.go package2.o -g0 $ gdb -q -batch a.out -ex "break package2.Foo" Breakpoint 1 at 0x402563 ... the breakpoint is set just fine. When generating dwarf info: ... $ gccgo-7 ./src/gdb/testsuite/gdb.go/package2.go -c -g $ gccgo-7 ./src/gdb/testsuite/gdb.go/package1.go package2.o -g $ gdb -q -batch a.out -ex "break package2.Foo" Breakpoint 1 at 0x402563: file ./src/gdb/testsuite/gdb.go/package2.go, line 5. ... we get line info in addition, but the dwarf is not actually used to find the function address. I only found this out during debugging, I didn't find a good way to demonstrate it otherwise: ... (gdb) fin Run till exit from #0 find_linespec_symbols (state=0x7fffffffcd10, file_symtabs=std::vector of length 1, capacity 1 = {...}, lookup_name=0x370a770 "package2.Foo", name_match_type=symbol_name_match_type::WILD, symbols=0x7fffffffc980, minsyms=0x7fffffffc960) at /data/vries/gdb/src/gdb/linespec.c:3814 linespec_parse_basic (parser=0x7fffffffcce0) at linespec.c:1822 1822 if (!symbols.empty () || !minimal_symbols.empty ()) (gdb) p symbols.empty () $1 = true (gdb) p minimal_symbols.empty () $2 = false ... The expansion of the symtab seems to be happening, but the following search in the expanded symtab fails to return anything. My guess is that package2.Foo fails to match on go.package2.Foo: ... block #000, object at 0x476a640, 2 symbols in 0x402563..0x40263f void go.package2.Foo(void); block object 0x476a4c0, 0x402563..0x40263f section .text package2; block #001, object at 0x476a5f0 under 0x476a640, 0 symbols in 0x402563..0x40263f block #002, object at 0x476a4c0 under 0x476a5f0, 0 symbols in 0x402563..0x40263f, function go.package2.Foo, go.package2.Foo ... I tried the same with -ex "break go.package2.Foo", and in that case gdb does manage to find it in the expanded symtab. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2023-10-05 12:28 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-05 12:28 vries at gcc dot gnu.org [this message] 2023-10-05 13:09 ` [Bug go/30941] " vries at gcc dot gnu.org 2023-10-05 21:22 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-30941-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).