Discussion:
[Bug symtab/23331] New: failure in gdb.gdb with gcc 8.1
tromey at sourceware dot org
2018-06-22 17:12:48 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23331

Bug ID: 23331
Summary: failure in gdb.gdb with gcc 8.1
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---

I'm using gcc 8.1 (the system gcc) on x86-64 Fedora 28.

When running the gdb.gdb tests I see a failure like this:

(gdb) call catch_command_errors(execute_command, "python print(5)", 0)
Cannot resolve function catch_command_errors to any overloaded instance


I think this happens because gdb isn't finding the DWARF for
execute_command:

(top-gdb) print execute_command
$2 = {<text variable, no debug info>} 0x7ecec0 <execute_command(char const*,
int)>


However, the function is definitely in the DWARF:

[4d5a860] subprogram
external true
name "execute_command"
decl_file "../../binutils-gdb/gdb/top.c"
decl_line 540
decl_column 1
linkage_name "_Z15execute_commandPKci"
ranges 0x429cfc..0x429d32, 0x7ecec0..0x7ed3d3
frame_base 0..0xffffffffffffffff:0 call_frame_cfa
GNU_all_call_sites true
sibling [4d5b890] structure_type
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-06-22 17:54:44 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23331

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Setting a breakpoint in new_symbol shows that gdb is reading
this and making a symbol for it.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-06-22 18:14:56 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23331

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
However new_symbol in this case is called only because gdb has
already given up on finding the name and is now searching for the
PC using block_for_pc_sect. So, something has gone wrong earlier,
I think.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-06-22 19:39:32 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23331

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
load_partial_dies skips this DIE because it doesn't think it
has PC info.
I think partial_die_info::read needs to be updated for
DW_AT_ranges.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-06-22 19:41:20 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23331

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
And, btw, double-dwarf-reader bites again, because dwarf2_get_pc_bounds
understands ranges.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...