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 ada/25736] New: psym_map_matching_symbols finds symbol in partial symtab, but not in full symtab Date: Fri, 27 Mar 2020 09:55:02 +0000 [thread overview] Message-ID: <bug-25736-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=25736 Bug ID: 25736 Summary: psym_map_matching_symbols finds symbol in partial symtab, but not in full symtab Product: gdb Version: HEAD Status: NEW Severity: minor Priority: P2 Component: ada Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- The function psym_map_matching_symbols looks like this: ... for (partial_symtab *ps : require_partial_symbols (objfile, true)) { QUIT; if (ps->readin_p () || match_partial_symbol (objfile, ps, global, name, domain, ordered_compare)) { struct compunit_symtab *cust = psymtab_to_symtab (objfile, ps); const struct block *block; if (cust == NULL) continue; block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), block_kind); if (!iterate_over_symbols_terminated (block, name, domain, callback)) return; } } ... So if a symtab is not already expanded, it tries to find the symbol in the partial symtab, and if so, expands the partial symtab into the full symtab and tries to find the symbol there. I wrote an assert to check that if psym_map_matching_symbols finds a symbol in a partial symbol table, and expands it, it should find a matching symbol in the expanded symbol table. [ Likewise, we could also write an assert that if psym_map_matching_symbols does not find a symbol in a partial symbol table, it should also not find one in the full symbol table. ] In a full test run, I ran only into: ... FAIL: gdb.ada/bp_inlined_func.exp: set breakpoint at read_small (GDB internal error) ... Which can be reproduced using: ... $ gdb \ -batch \ outputs/gdb.ada/bp_inlined_func/foo \ -ex 'b main' \ -ex r \ -ex 'b read_small' ... Inspecting the assert shows that the partial/full symtabs are related to foo.adb: ... (gdb) p ps.filename $7 = 0x1a87c90 "/data/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/bp_inlined_func/foo.adb" (gdb) p cust.name $8 = 0x1b2ebe0 "foo.adb" ... and inspecting the partial symbols gives us: ... (gdb) call maintenance_print_psymbols (0, 0) Partial symtab for source file /data/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/bp_inlined_func/foo.adb (object 0x1a94660) Read from object file /data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/bp_inlined_func/foo (0x13103b0) Full symtab was read (at 0x1b2eb70) Symbols cover text addresses 0x402066-0x4020a2 Address map supported - yes. Depends on 0 other partial symtabs. Global partial symbols: `_ada_foo' `foo', function, 0x402066 `b__read_small' `b.read_small', function, 0x40206f ... while inspecting the full symbols gives us: ... Symtab for file /data/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/bp_inlined_func/foo.adb at 0x1b2ebf0 Compilation directory is /data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/bp_inlined_func Read from object file /data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/bp_inlined_func/foo (0x13103b0) Language: ada Line table: line 18 at 0x402066 (stmt) line 20 at 0x40206a (stmt) line 0 at 0x40206f (stmt) line 22 at 0x40209a (stmt) line 23 at 0x40209f (stmt) line 0 at 0x4020a2 (stmt) Blockvector: block #000, object at 0x1b2f000, 1 syms/buckets in 0x402066..0x4020a2 procedure foo; block object 0x1b2ef40, 0x402066..0x4020a2 block #001, object at 0x1b2efa0 under 0x1b2f000, 0 syms/buckets in 0x402066..0x4020a2 block #002, object at 0x1b2ef40 under 0x1b2efa0, 0 syms/buckets in 0x402066..0x4020a2, function _ada_foo, foo block #003, object at 0x1b2ee90 under 0x1b2ef40, 1 syms/buckets in 0x40206f..0x40209a, function b__read_small, b.read_small procedure b.read_small; block object 0x1b2ee90, 0x40206f..0x40209a ... I'm not sure yet if my assert is wrong, and this is expected behaviour, or something needs to be fixed. Filing for further investigation later. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2020-03-27 9:55 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-27 9:55 vries at gcc dot gnu.org [this message] 2020-03-27 9:56 ` [Bug ada/25736] " vries at gcc dot gnu.org 2020-04-02 12:48 ` vries at gcc dot gnu.org 2022-08-04 15:12 ` tromey at sourceware dot org 2022-10-17 20:02 ` tromey at sourceware dot 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-25736-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).