This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to lookup a symbol for vma using BFD?
2008/8/8 Dmitry Smirnov <divis1969@gmail.com>:
> I'm going to enforce comp_unit_maybe_decode_line_info() to load symbol
> info (call scan_unit_for_symbols() ) and comp_unit_find_line() to
> ignore result of comp_unit_maybe_decode_line_info.
Well, as I see, this will be non-trivial :-) since
scan_unit_for_symbols() supposes that unit->line_table is not NULL
Particularly, it tries concatenate the filename for some attributes
(like DW_AT_decl_file). This crashes the probram, of course.
What is interesting is that I've found that there could be several
compilation units for a single file. Some of them contain
DW_AT_stmt_list, some not.
Is it some kind of standard violation?
Program is crashed when it tries to process the unit with absent
DW_AT_stmt_list (I've made my changes to original code). For example,
DW_AT_decl_file processing is failed for a abbreviation below.
<1><1f18>: Abbrev Number: 39 (DW_TAG_subprogram)
DW_AT_sibling : <1f85>
DW_AT_decl_file : 2
DW_AT_decl_line : 528
DW_AT_decl_column : 0
DW_AT_name : adc_read_timeout_callback
DW_AT_external : 1
DW_AT_inline : 1 (inlined)
I'm wondering is such DWARF info not per spec? If DWARF allows this,
it means BFD should merge such units, isn't it?
Dmitry