* src/abg-comparison.cc
(RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER)
(RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER{2,3}): New
macros.
({pointer_diff, array_diff, reference_diff, qualified_type_diff,
class_diff, typedef_diff}::report): Use the new macros above.
* tests/data/test-bidiff/test-qual-type0-report.txt: Adjust
because type pretty representation are now always quoted.
* tests/data/test-bidiff/test-struct1-report.txt: Adjust likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* configure.ac: Support a new --enable-zip-archive option. By
default its value is set to the 'auto', meaning that if libzip is
installed, that turns the option on -- just like if
--enable-zip-archive was called with the value 'yes'; if libzip is
not installed, that turns the option off -- just like if
--enable-zip-archive was called with the value 'no'. If libzip is
detected, the pre-processor macro HAVE_LIBZIP is set to 1. If
--enable-zip-archive is turned on, the pre-processor macro
WITH_ZIP_ARCHIVE is set to 1.
* config.h.in (HAVE_LIBZIP, WITH_ZIP): New define.
* src/abg-corpus.cc: Include config.h. Guard the inclusion of
abg-libzip-utils.h with the WITH_ZIP_ARCHIVE macro. Likewise for
the use of declarations coming from abg-libzip-utils.h.
* src/abg-libzip-utils.cc: Include config.h. Guard the file's
content with the WITH_ZIP_ARCHIVE macro.
* src/abg-reader.cc: Include config.h. Guard the inclusion of
abg-libzip-utils.h with the WITH_ZIP_ARCHIVE. Likewise for the
use of declarations coming from abg-libzip-utils.h.
* src/abg-writer.cc: Likewise.
* tests/Makefile.am: Build runtestwritereadarchive and runtestdot
only if zip archives are supported.
* tools/Makefile.am: The biar program is built only if
zip archives are supported.
* tools/bidiff.cc: Handle zip archives only if the
WITH_ZIP_ARCHIVE macros is defined.
* tools/bilint.cc: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tools/bidiff.cc (options::{display_usage,missing_operand}): New
data members.
(options::options): Initialize them.
(parse_command_line): Flag missing operands. Return false only
when an option could not be parsed. Flag when the user wants us
to display help.
(main): Tell --help, wrong options and missing argument apart and
give an appropriate message on stderr. The help string goes to
stdout though. Just like what GNU diff does.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc (ENSURE_DIFF_NODE_TRAVERSED_ONCE): If the
diff node is being traversed for the first time, mark it as being
in the NOT_REDUNDANT_CATEGORY. I don't know why I was doing this
only for classes and basic types. Update comments.
* tests/data/test-diff-filter/test16-report.txt: New test input.
* tests/data/test-diff-filter/test16-v0.cc: Source code of new
test input.
* tests/data/test-diff-filter/test16-v0.o: New test input.
* tests/data/test-diff-filter/test16-v1.cc: Source code of new
test input.
* tests/data/test-diff-filter/test16-v1.o: New test input.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
* tests/data/test-diff-filter/test17-1-report.txt: Likewise.
* tests/data/test-diff-filter/test17-v0.cc: Source code of new
test input.
* tests/data/test-diff-filter/test17-v0.o: Likewise.
* tests/data/test-diff-filter/test17-v1.cc: Source code of new
test input.
* tests/data/test-diff-filter/test17-v1.o: Likewise.
* tests/Makefile.am: Add the new files to the source distribution.
* tests/test-diff-filter.cc (in_out_spec): Run this test harness
over the new test inputs.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Set
the name of anonymous structs to '__anonymous_struct_'.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tools/bidiff.cc (display_usage): Change--no-linkage-names -o
--no-linkage-name in the help string.
(parse_command_line): Adjust the command line parsing accordingly.
* tests/test-diff-filter.cc (in_out_specs): Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc (represent, corpus_diff::report): show
symbol version info in linkage name info.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-ir.cc (elf_symbol::operator==): Rather than comparing
bindings, compare public-ness here. That is, if two symbol
versions' differ because one is GLOBAL and the other one is WEAK,
they should still be considered equal, from an ABI standpoint.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc
({class,corpus}_diff::ensure_lookup_tables_populated): Now that in the
intermediate maps we store symbol *ids* rather than symbol names,
make sure to really refer to symbol names for symbol lookups,
rather than (wrongly) referring to symbol ids.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tools/bidiff.cc (display_usage): Add help strings for --harmless
and --no-harmful.
(main): Emit the help string to stdout, not stderr.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tools/bidiff.cc (display_usage): Remove the help string for the
--no-harmless option that doesn't exist anymore, as it's on by
default.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-ir.h ({var,function}_decl::get_id): New member
function declarations.
* src/abg-ir.cc ({var,function}_decl::get_id): New member function
definitions.
* src/abg-comparison.cc
(corpus_diff::priv::ensure_lookup_tables_populated): Use the
::get_id() function to get an identifier for the function or
variable.
* src/abg-corpus.cc (symtab_build_visitor_type::build_id): Use the
get_id of the function/variable.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (read_context::alternate_die_decl_map):
Return the real alternate die decl map, rather than what we was
doing previously b/c of a stupid copy/paste. Oh well.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-corpus.h
(corpus::lookup_{function,variable}_symbol): Add an overload
declaration that takes the version of the symbol to lookup.
* src/abg-comparison.cc
(corpus_diff::priv::ensure_lookup_tables_populated): So when looking
up the corpora for symbols, take their versions in account.
* src/abg-corpus.cc (corpus::lookup_{function,variable}_symbol):
Add an overload definition that takes the version of the symbol to
lookup.
(symtab_build_visitor_type::build_id): New
member functions.
(corpus::priv::build_public_decl_table): Use the new member
functions above.
* src/abg-ir.cc (elf_symbol::version::operator==): Do not take the
is_default flag in account when comparing two symbol versions.
* libtest12-v{0,1}.so: New test input files.
* libtest12-v{0,1}.c: Source code for the test input files.
* test12-version-script: Version script to build the files above.
* test12-report.txt: Test input file.
* tests/Makefile.am: Add the new test input files above to the
source distribution.
* tests/test-diff-dwarf.cc (in_out_specs[]): Add an entry to this
table for the new test input files.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-corpus.h (corpus::lookup_function_symbol)
(corpus::lookup_variable_symbol): Add the name of the function
parameter in the declaration.
* include/abg-ir.h (elf_symbol::version::version): Properly indent
this constructor declaration.
* src/abg-corpus.cc
(symtab_build_visitor_type::symtab_build_visitor_type): Properly
indent constructor parameters.
* src/abg-ir.cc (function_decl::operator==): Fix typo in
comments.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tools/bidiff.cc (display_usage): remove the '--harmful' line
from the help string as this option is now activated by default.
It's --harmless that exists now.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-comp-filter.h (has_harmless_name_change): New
function declaration.
* include/abg-comparison.h
(diff_category::DECL_NAME_CHANGE_CATEGORY): Renamed this into
HARMLESS_DECL_NAME_CHANGE_CATEGORY.
(diff_category::EVERYTHING_CATEGORY): Update.
* include/abg-fwd.h (is_enum): New function declaration.
(is_var_decl): Return the shared_ptr<var_decl> rather than a bool.
(is_data_member): New overload that takes a shared_ptr<decl_base>.
* src/abg-comp-filter.cc (decl_name_changed): Consider the
qualified name here.
(has_harmless_name_change): Define new function declaration.
(harmless_filter::visit): Use the new has_harmless_name_change
function.
* src/abg-comparison.cc (represent)
(report_name_size_and_alignment_changes, enum_diff::report)
(typedef_diff::report, is_data_member): Use the new
filtering::has_harmless_name_change function to simplify logic of
emitting the name change related diff
* tools/bidiff.cc (set_diff_context_from_opts): Adjust
DECL_NAME_CHANGE_CATEGORY -> HARMLESS_DECL_NAME_CHANGE_CATEGORY.
* src/abg-ir.cc (is_data_member, is_enum): New function definitions.
(is_var_decl): Return the var_decl_sptr rather than just a bool.
* tests/data/test-diff-filter/test13-report.txt: Adjust.
* tests/data/test-diff-filter/test6-report.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-comparison.h (array_diff): Declare new class.
(array_diff_sptr): Shared pointer to type array_diff.
(compute_diff): Overload the function to take type
array_diff_sptr as the first two arguments.
* include/abg-fwd.h (array_type_def): Declare new class.
(subrange_type): Likewise.
(is_array_def): Declare new function.
* include/abg-ir.h (array_type_def_sptr): Shared pointer
to type array_type_def.
(array_type_def): Declare new class.
(ir_node_visitor::visit): Declare a new virtual function
taking a pointer to type array_type_def as an argument.
* src/abg-comparison.cc (compute_diff_for_types): Add
try_to_diff for two instances of type array_type_def.
(array_diff::priv): declare struct for holding private members
of type array_diff.
(array_diff::array_diff): Define constructor.
(array_diff::{first,second}_array):Define new
member functions.
(array_diff::element_type_diff): Likewise.
(array_diff::{length,report,traverse}): Likewise.
(compute_diff): Define function overloaded in
include/abg-comparison.h.
* src/abg-dwarf-reader.cc (build_array_type): Define new
function. Handle DW_TAG_array_type and DW_TAG_subrange type.
(build_ir_node_from_die): Amend case DW_TAG_array_type with
a call to build_array_type.
* src/abg-hash.cc (array_type_def::hash): Declare new struct.
(type_base::dynamic_hash::operator()): Attempt to dynamic_cast
the argument to type array_type_def as well.
(array_type_def::hash): Declare new struct.
* src/abg-ir.cc (array_type_def::array_type_def): Define
constructors.
(array_type_def::priv): declare struct for holding private members
of type array_type_def.
(array_type_def::operator==(const decl_base&):
Define new operator.
(array_type_def::operator==(const type_base&):
Likewise.
(array_type_def::append_subrange{,s}): Define
new functions.
(array_type_def::{set,get}_size_in_bits): Likewise.
(array_type_def::get_dimension_count): Likewise.
(array_type_def::get_qualified_name): Likewise.
(array_type_def::get_pretty_representation): Likewise.
(array_type_def::get_subrange_representation): Likewise.
(array_type_def::traverse): Likewise.
(array_type_def::get_{element_type,location,subranges}): Likewise.
(array_type_def::is_infinite): Likewise.
(array_type_def::~array_type_def): Define destructor.
(ir_node_visitor::visit): Define function, taking
pointer to array_type_def as an argument.
* src/abg-reader.cc (map_id_and_node): Check if node
is an array.
(is_array_def): Check if object is an array.
(handle_element_node): Handle array_type_def as well.
(build_subrange_type): Define new function.
(build_array_type_def): Likewise.
(build_type): Build type array_type_def as well.
(build_type_composition): Likewise.
(handle_array_type_def): Define new function.
* src/abg-writer.cc: (write_decl): Output arrays
as well.
(write_member_type): Likewise.
(write_type_composition): Likewise.
(write_array_type_def): Define new function.
* tests/data/test-diff-dwarf/test{10,11}-v{0,1}.{cc,o}: New test source
files
* tests/data/test-diff-dwarf/test{10,11}-report.txt: Likewise.
* tests/data/test-diff-dwarf/test10-report.txt: New test input.
* tests/data/test-read-dwarf/test7.cc: New test source
file.
* tests/data/test-read-dwarf/test7.so: New input binary
to read.
* tests/data/test-read-dwarf/test7.so.abi: New reference
test to compare against.
* tests/data/test-read-write/test25.xml: New test source
file.
* tests/test-diff-dwarf.cc: Adjust to launch the new test.
* tests/test-read-dwarf.cc: Likewise.
* tests/test-read-write.cc: Likewise.
* test/Makefile.am: Add the new test inputs to the source
distribution.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-ir.cc (elf_symbol::is_variable): Accept TLS objects as
variables too.
* src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr)
(die_location_address): Add an output parameter to say if the
resulting constant value is a tls address or not.
(lookup_public_variable_symbol_from_elf): Use the proper
elf_symbol::is_variable() method, rather than trying to figure out
the low levels of what a variable is here. Also, cleanup the
condition.
(read_context::load_symbol_maps): Consider symbols of type
STT_TLS, when loading symbols for variables. Also, to avoir
symbols that are for versions, filter out symbols of type
STT_OBJECT and with a SHN_ABS section index.
(read_context::get_variable_address): If the address is for a tls
variable, do no try to adjust the address to arrange for things
like prelink. As that doesn't seem to affect TLS variables.
(dwarf_expr_eval_context::set_tls_addr): New data member.
(dwarf_expr_eval_context::dwarf_expr_eval_context): Initialize it.
(dwarf_expr_eval_context::set_tls_address): New accessors.
(dwarf_expr_eval_context::op_manipulates_stack): Handle
DW_OP_GNU_push_tls_address, a bit like DW_OP_form_tls_address, but
then, its result is a constant. Set the
dwarf_expr_eval_context::set_tls_addr flag when these two OPs are
run.
(die_member_offset): Adjust to the new signature of
eval_last_constant_dwarf_sub_expr.
* tests/data/test-diff-dwarf/libtest9-v0.so: New test input.
* tests/data/test-diff-dwarf/libtest9-v1.so: Likewise.
* tests/data/test-diff-dwarf/test9-report.txt: Likewise
* tests/data/test-diff-dwarf/test9-v0.cc: Source code for the
first input.
* tests/data/test-diff-dwarf/test9-v1.cc: Source code for the
second input.
* tests/test-diff-dwarf.cc: Run this harness on the two new inputs
above.
* tests/Makefile.am: Add the new inputs to the source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug:
Make this link be relative.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
ABGBZ#17193
* include/abg-dwarf-reader.h (class read_context)
(typedef read_context_sptr, create_read_context)
(has_alt_debug_info): Declare these.
(read_corpus_from_elf): Declare new overload.
* src/abg-dwarf-reader.cc (find_alt_debug_info)
(is_die_attribute_resolved_through_gnu_ref_alt)
(build_primary_die_parent_relations_under)
(build_alternate_die_parent_relations_under):
Define new static functions.
(read_context::{alt_dwarf_,
alt_debug_info_path_, alternate_die_decl_map_,
alternate_die_parent_map_}): New data members.
(read_context::{alt_dwarf, alt_debug_info_path,
alternate_die_decl_map, associate_die_to_decl_primary,
associate_die_to_decl_alternate, associate_die_to_decl,
lookup_decl_from_die_offset_primary,
lookup_decl_from_die_offset_alternate,
lookup_decl_from_die_offset, alternate_die_parent_map}): New
member functions.
(read_context::load_debug_info): Painfully Get a handle on the
alternate debug info section too. We shouldn't have to do all
this work; we could use the new dwarf_getalt() function from
libdw, but we cannot as we want to support supports that predate
that api. When a version of elfutils gets released with that api
though, we should conditionally use that instead.
(build_ir_node_from_die, get_parent_die, get_scope_for_die)
(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): Take a new parameter that
tells if the input DIE is from alternate debug info. Adjust their
code accordingly.
(die_die_attribute): Take a new output parameter that tells if the
resolved DIE is from alternate debug info. Also take a new
parameter that tells if the input DIE is from alternate debug info
sections.
(build_die_parent_relations_under): Take the DIE -> parent map to
act upon. Also, add a new overload that takes a flag saying if
the DIE is from alternate debug info or not, and act upon that.
(build_die_parent_maps): Renamed build_die_parent_map into this
and make it build DIE -> parent DIE relationship for the alternate
debug info file as well.
(find_last_import_unit_point_before_die, ): Adjust to use the
information about if the relevant DIEs are in alternate debug info
or not.
(build_translation_unit_and_add_to_ir): Clear the alternate DIE ->
decl map, that is per TU just as the primary DIE -> decl map.
Adjust to use the information about if the relevant DIEs are in
alternate debug info or not.
(read_debug_info_into_corpus): Build the two DIE -> DIE parent
maps (one for the primary debug info and one for the alternate
debug info).
(create_read_context, has_alt_debug_info): Define new public entry
points.
(read_corpus_from_elf): New entry point overload that takes a
read_context.
* tools/bidw.cc (options::{check_alt_debug_info_path,
show_base_name_alt_debug_info_path}): New data members.
(display_usage): Update for the two new options
--check-alternate-debug-info and
check-alternate-debug-info-base-name.
(parse_command_line): Parse the two options above.
(main) Handle the two new options above.
* tests/Makefile.am: Build the new runtestaltdwarf test. Add the
new data/test-alt-dwarf-file/* files to the build system.
* tests/test-alt-dwarf-file.cc: New test driver.
* tests/data/test-alt-dwarf-file/test0-common.cc: New test input
files.
* tests/data/test-alt-dwarf-file/libtest0-common.so: Likewise.
* tests/data/test-alt-dwarf-file/test0.cc: Likewise.
* tests/data/test-alt-dwarf-file/libtest0.so: Likewise.
* tests/data/test-alt-dwarf-file/test0.h: Likewise.
* tests/data/test-alt-dwarf-file/test0-common-dwz.debug: Likewise.
* tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug:
Likewise.
* tests/data/test-alt-dwarf-file/test0-debug-dir/test0-common-dwz.debug:
Likewise.
* tests/data/test-read-dwarf/test1.abi: Adjust. bidw doesn't emit
an abstract constructor/destructor anymore. It emits just the
functions matching the cdtor symbols found in the binary.
* tests/data/test-read-dwarf/test2.so.abi: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (build_pointer_type_def): Better
support cases where the underlying type of the pointer is not
know. In that case, the pointer should not be created.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (get_binary_load_address): New function
definition.
(read_context::elf_handle): Add comment.
(read_context::{dwarf_elf_handle, dwarf_is_splitted,
maybe_adjust_address_for_exec_or_dyn}): New method definitions.
(maybe_adjust_fn_sym_address)
(maybe_adjust_var_sym_address): Move these so they become members
of read_context. Also, For shared libraries and executable (that
could have been e.g prelinked), consider their loading address
when trying to find which symbol resides at a given place in
memory.
(read_context::{get_function_address, get_variable_address):
Adjust.
(build_translation_unit_and_add_to_ir): Fix comment.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir):
Clear the void_type_decl on new translation units.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-ir.cc (is_public): Change in function to consider
symbols with STB_GNU_UNIQUE binding as public
* tests/data/test-read-dwarf/test6.cc: Test file to generate
STB_GNU_UNIQUE binding symbols
* tests/data/test-read-dwarf/test6.so: Test shared library having
STB_GNU_UNIQUE binding symbols
* tests/data/test-read-dwarf/test6.so.abi: XML file containing
dwarf information from test6.so
* tests/test-read-dwarf.cc (in_out_specs): Add the new test above
* tests/Makefile.am: Add tests/data/test-read-dwarf/test6.cc,
tests/data/test-read-dwarf/test6.so and
tests/data/test-read-dwarf/test6.so.abi to the distribution
Signed-off-by: Sinny Kumari <skumari@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-ir.h (type_decl::get_void_type_decl): Declare new
static method.
* src/abg-ir.cc (type_decl::get_void_type_decl): Define it.
* src/abg-dwarf-reader.cc (build_ir_node_for_void_type): Define
new static function.
(build_pointer_type_def): Support void* type nodes here.
* tests/data/test-read-dwarf/test5.cc: Source code for new test
input.
* tests/data/test-read-dwarf/test5.o: New test input.
* tests/data/test-read-dwarf/test5.o.abi: Likewise.
* tests/Makefile.am: Add the above to the source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/Makefile.am: Add the subdir-object automake option here.
Do not specify absolute paths for the input files as Automake now
takes care of that just fine.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
* include/abg-comp-filter.h (class harmful_filter): Update
comment.
(class redundant_filter): Declare new filter.
* include/abg-comparison.h (enum
diff_category::NOT_REDUNDANT_CATEGORY): New category. Update the
values of the other enumerators.
(diff_context::{add_diff, diff_has_been_traversed}): New overloads.
(diff_context::{categorizing_redundancy, show_redundant_changes}):
Declare new methods.
(diff_context::remove_from_category): Define new inline method.
* src/abg-comparison.cc (noop_deleter::operator()): Constify the
parameter.
(CATEGORIZE_REDUNDANCY_FROM_CHILD_NODE)
(UPDATE_REDUNDANCY_CATEGORIZATION_FROM_NODE_SUBTREE): New macros.
(TRAVERSE_DIFF_NODE_AND_PROPAGATE_CATEGORY)
(TRAVERSE_MEM_DIFF_NODE_AND_PROPAGATE_CATEGORY)
(TRAVERSE_MEM_FN_DIFF_NODE_AND_PROPAGATE_CATEGORY): Use the new
CATEGORIZE_REDUNDANCY_FROM_CHILD_NODE and
UPDATE_REDUNDANCY_CATEGORIZATION_FROM_NODE_SUBTREE macros above.
(ENSURE_DIFF_NODE_TRAVERSED_ONCE)
(ENSURE_MEM_DIFF_NODE_TRAVERSED_ONCE): If the (type_decl or class)
node hasn't been yet traversed, mark it as non-redundant.
(diff_context::priv::categorizing_redundancy): New member.
(diff_context::priv::priv): Initialize it.
(diff_context::{add_diff, diff_has_been_traversed): Define new
overloads.
(diff_context::mark_diff_as_traversed): Intern a diff node that is
marked as being traversed.
(diff_context::{categorizing_redundancy, show_redundant_changes}):
Define new methods.
(diff::is_filtered_out): A redundant function or top-level
variable is considered filtered-out. Otherwise, the new
NOT_REDUNDANT_CATEGORY doesn't play any role when comparing
allowed categories with the set of categories a diff node belongs
to.
(corpus::priv::categorize_redundant_changed_sub_nodes): Define
new member function.
(corpus_diff::priv::apply_filters_and_compute_diff_stats): Change
this to first walk the changed functions and variables to apply
filters, then categorize redundant changed functions, and then
walk the changed functions and variables again to count
filtered-out diff nodes.
(filtering::redundant_filter::visit): Define new member function.
* tools/bidiff.cc (options::show_redundant_changes): New data
member.
(options::options): Initialize it.
(display_usage): Add help string for the --redundant command line
option.
(parse_command_line): Add support for the --redundant command line
option.
(set_diff_context_from_opts): Take the --redundant command line
option in account.
* tests/test-diff-filter.cc: Update this to add new test inputs.
* tests/data/test-diff-filter/test14-0-report.txt: New test input.
* tests/data/test-diff-filter/test14-1-report.txt: Likewise.
* tests/data/test-diff-filter/test14-v0.cc: Likewise.
* tests/data/test-diff-filter/test14-v0.o: Likewise.
* tests/data/test-diff-filter/test14-v1.cc: Likewise.
* tests/data/test-diff-filter/test14-v1.o: Likewise.
* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
* tests/data/test-diff-filter/test15-1-report.txt: Likewise.
* tests/data/test-diff-filter/test15-v0.cc: Likewise.
* tests/data/test-diff-filter/test15-v0.o: Likewise.
* tests/data/test-diff-filter/test15-v1.cc: Likewise.
* tests/data/test-diff-filter/test15-v1.o: Likewise.
* tests/Makefile.am: Add the above to the build system.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-ir.cc (demangle_cplus_mangled_name): When the demangler
fails to demangle a name, just return the input name as-is.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-writer.cc (write_elf_symbol_aliases): Changing function
to keep multiple symbol aliases within one alias attribute
* src/abg-reader.cc (build_elf_symbol_db): Changing function to read
symbol's alias attribute and split if multiple alias exist with comma(,)
asi a delimiter and add all aliases to main symbol
* tests/data/test-read-dwarf/test3.c: Test file to generate multiple aliases
* tests/data/test-read-dwarf/test3.so: Test shared library having multiple
aliases of a symbol
* tests/data/test-read-dwarf/test3.so.abi: XML file containing dwarf
information from test3.so
* tests/test-read-dwarf.cc (in_out_specs): Add the new test above
* tests/Makefile.am: Add tests/data/test-read-dwarf/test3.c,
tests/data/test-read-dwarf/test3.so and tests/data/test-read-dwarf/test3.so.abi
to the distribution
Signed-off-by: Sinny Kumari <skumari@redhat.com>
DW_TAG_mutable_type was a mistake in an early DWARFv3 draft and was removed
in the final version. http://dwarfstd.org/ShowIssue.php?issue=050223.1
* src/abg-dwarf-reader.cc (is_type_tag): Remove DW_TAG_mutable_type.
(build_ir_node_from_die): Likewise.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
* src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): To
tell if a member function is static, look if the first parm is a
pointer to the type of the enclosing class, and if it's
artificial. Don't bother trying to be smart by looking at the
non-presence of DW_AT_object_pointer b/c that attribute wasn't
emitted by GCC 4_4.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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>