This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with BFD


I'm sorry, I made a mistake while evaluating this  BFD_ASSERT
(!unit->cached)  :-)

Obviously, it asserts if unit->cached already TRUE.

After some debugging I see that comp_unit_maybe_decode_line_info has
returned TRUE.
This is because unit->error is 0 and unit->line_table is non-zero.
On my mind, something wrong with this function.
If you take a look at the unit, its line_table is non-NULL but
variable_table and function_table are NULL.
Shouldn't comp_unit_maybe_decode_line_info set error if any of
variable_table and function_table are NULL?


#0  bfd_assert (file=0x4e5039 "./dwarf2.c", line=2422) at bfd.c:920
#1  0x0042ef1f in stash_maybe_update_info_hash_tables (stash=0xcb1f28)
    at ./dwarf2.c:2422
#2  0x0042f81c in find_line (abfd=0x32dc0, section=0x37f70, offset=0,
    symbol=0x49fb770, symbols=0xdb0020, filename_ptr=0x23fa04,
    functionname_ptr=0x0, linenumber_ptr=0x23fa08, addr_size=0, pinfo=0x34ff0)
    at ./dwarf2.c:3093
#3  0x00430297 in _bfd_dwarf2_find_line (abfd=0x32dc0, symbols=0xdb0020,
    symbol=0x49fb770, filename_ptr=0x23fa04, linenumber_ptr=0x23fa08,
    addr_size=0, pinfo=0x34ff0) at ./dwarf2.c:3270
#4  0x00439e72 in _bfd_elf_find_line (abfd=0x32dc0,
    symbols=<incomplete type>, symbol=0x49fb770, filename_ptr=0x23fa04,
    line_ptr=0x23fa08) at elf.c:7208
#5  0x00405cc5 in CBFD::findLine (this=0x32d60, symbol=0x49fb770,
    filename=..., line=@0x23fac8) at cbfd.cpp:288
#6  0x0040473b in main (argc=7, argv=0x32570) at main.cpp:223
(gdb) frame 1
#1  0x0042ef1f in stash_maybe_update_info_hash_tables (stash=0xcb1f28)
    at ./dwarf2.c:2422
2422    ./dwarf2.c: No such file or directory.
        in ./dwarf2.c
(gdb) p *each
$1 = {next_unit = 0x0, prev_unit = 0xcb4a10, abfd = 0x32dc0, arange = {
    next = 0x0, low = 0, high = 0},
  name = 0x4d9002c "glide\\headers\\comdef.h", abbrevs = 0x35d28, error = 0,
  comp_dir = 0x0, stmtlist = 1, info_ptr_unit = 0x4d90020 "А\001",
  line_offset = 9536,
  first_child_die_ptr = 0x4d90071 "\004\001\bunsigned char",
  end_ptr = 0x4d901a4 "$\001", line_table = 0x36768, function_table = 0x0,
  variable_table = 0x0, stash = 0xcb1f28, version = 2, addr_size = 4 '\004',
  offset_size = 4 '\004', base_address = 0, cached = 1}
(gdb)


2009/11/23 Dmitry Smirnov <divis1969@gmail.com>:
> Hi,
>
> I'm encountering some problem with BFD (2.20.51.20090916 which I
> grabbed from GDB 7.0). While attempting to find a line info, it
> produces the following message:
>
> BFD: BFD (GNU Binutils) 2.20.51.20090916 assertion fail ./dwarf2.c:2422
>
> This line contains:
> BFD_ASSERT (!unit->cached);
>
> I had found that unit->cached set to TRUE only few lines below (in this file).
> So, I'm wondering, what is the purpose of this assert? Is it supposed
> that this flag canbe set somewhere else (not in dwarf2.c)?
>
> Dmitry
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]