* include/abg-dwarf-reader.h (enum status): New enum.
(read_corpus_from_elf): Return an instance of status above, and
return the corpus by parameter.
* src/abg-dwarf-reader.cc (create_default_dwfl): Add a comment
about elfutils wanting the Dwfl_Callbacks::debuginfo_path to be an
absolute path.
(read_corpus_from_elf): Return an instance of status above, and
return the corpus by parameter.
* tools/abg-tools-utils.h (make_path_absolute): Declare new function.
* tools/abg-tools-utils.cc (make_path_absolute): New
implementation.
* tools/bidiff.cc (options::di_root_path[12]): Make these be
shared pointers.
(parse_command_line): ensure the debug info root paths are
absolute.
(main): Adjust. Give meaningful errors when the debug info or
symbol files couldn't be read.
* tools/bidw.cc (options::di_root_path): Make this be a shared
pointer.
(parse_command_line): Ensure the debug info root path is absolute.
(main): Adjust. Give meaningful errors when the debug info or
symbol files couldn't be read.
* tools/bilint.cc (options::di_root_path): Make this be a shared
pointer.
(parse_command_line): Ensure the debug info root path is absolute.
(main): Adjust. Give meaningful errors when the debug info or
symbol file couldn't be read.
* tests/test-diff-dwarf.cc (main): Adjust.
* tests/test-read-dwarf.cc (main): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-dwarf-reader.h (read_corpus_from_elf): Take a
debug_info_root_path parameter.
src/abg-dwarf-reader.cc (create_default_dwfl): Take a
debug_info_root_path. Use that to initialize the Dwfl_Callbacks
structure used by dwfl_begin.
(create_default_dwfl_sptr, read_corpus_from_elf): Likewise, Take a
debug_info_root_path parameter.
* tests/test-diff-dwarf.cc (main): Adjust.
* tests/test-read-dwarf.cc (main): Likewise.
* tools/bidiff.cc (options::dir_root_path[12]): New member.
(options::options): Initialize it.
(display_usage): Add help string for the --debug-info-dir[12]
options.
(parse_command_line): Handle the new --debug-info-dir[12] options.
(main): Pass the debug info directories to read_corpus_from_elf.
* bidw.cc (options::::di_root_path): New member.
(options::options): Initialize it.
(display_usage): Add help string for the new --debug-info-dir
option.
(parse_command_line): Handle the new --debug-info-dir.
(main): Pass the debug info root path to read_corpus_from_elf.
* tools/bilint.cc (options::di_root_path): New member.
(options::options): Initialize it.
(display_usage): Add help string for the new --debug-info-dir.
(parse_command_line): Handle --debug-info-dir command line option.
(main): Pass the debug info root path to read_corpus_from_elf.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (read_context::cur_tu_die_): New member.
(read_context::read_context): Initialize the new member.
(read_context::cur_tu_die): New accessors.
(find_last_import_unit_point_before_die): New static function.
(get_parent_die): Take a logical current die offset parameter. If
the die we want the parent for is a partial unit, then find the
last DW_TAG_imported_unit that imports that partial unit before
the logical current die and return the parent of that
DW_TAG_imported_unit die.
(get_scope_for_die): Take a logical current die offset parameter.
Adjust.
(build_translation_unit_and_add_to_ir): Set/unset the current
translation unit DIE in the context. Adjust.
(build_namespace_decl_and_add_to_ir)
(build_class_type_and_add_to_ir, build_qualified_type)
(build_pointer_type_def, build_reference_type, build_typedef_type)
(build_var_decl, build_function_decl, build_ir_node_from_die):
Take a logical current die offset parameter. Adjust.
(build_corpus): Accept that we can have DIE that are not
DW_TAG_compile_unit at the top level, because, well, we can now
have DW_TAG_partial_unit too.
* tests/data/test-read-dwarf/test2-{0,1}.cc: New test source
files.
* tests/data/test-read-dwarf/test2.h: Likewise.
* tests/data/test-read-dwarf/test2.so: New input binary to read.
* tests/data/test-read-dwarf/test2.so.abi: New reference test to
compare against.
* tests/test-read-dwarf.cc: Adjust to launch the new test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>