Commit Graph

511 Commits

Author SHA1 Message Date
Mark Wielaard
453ed93d01 Handle C99 restrict qualifier and DWARFv3 DW_TAG_restrict_type.
* src/abg-dwarf-reader.cc (build_qualified_type): Handle
	DW_TAG_restrict_type by adding CV_RESTRICT.
	(build_ir_node_from_die): Call build_qualified_type for
	DW_TAG_restrict_type.
	* src/abg-reader.cc (build_qualified_type_decl): Handle
	"restrict" attribute by adding CV_RESTRICT.
	* src/abg-writer.cc (write_qualified_type_def): Output
	"restrict" attribute for CV_RESTRICT.
	* tests/data/test-read-dwarf/test4.c: New test file.
	* tests/data/test-read-dwarf/test4.so: Likewise.
	* tests/data/test-read-dwarf/test4.so.abi: Likewise.
	* tests/data/test-read-write/test24.xml: Likewise.
	* tests/test-read-dwarf.cc (in_out_specs): Add test4.
	* tests/test-read-write.cc (in_out_specs): Add test24.xml.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2014-06-23 15:55:37 +02:00
Dodji Seketeli
a8285b1f9c Add subdir-objects automake option where it is needed
* 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>
2014-06-23 15:01:00 +02:00
Dodji Seketeli
e4ad1ea740 Remove autotools artifacts from the repository
* config.guess: Remove from revision control system.
	* config.sub: Likewise.
	* depcomp: Likewise.
	* m4/libtool.m4: Likewise.
	* missing: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-06-23 14:20:46 +02:00
Dodji Seketeli
591014bf40 Avoid reporting diff nodes that have already been reported
* 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>
2014-06-23 13:43:42 +02:00
Dodji Seketeli
effab01a0e A name that couldn't be demangled remains the same
* 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>
2014-06-23 13:43:33 +02:00
Dodji Seketeli
f3f2382396 Update copyright notice for a bunch of files
* include/abg-comp-filter.h: Update copyright notice.
	* include/abg-comparison.h: Likewise.
	* src/abg-comparison.cc: Likewise.
	* src/abg-ir.cc: Likewise.
	* tools/bidiff.cc: Likewise.
	* tests/test-diff-filter.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-06-23 13:43:07 +02:00
Sinny Kumari
64bd3adce5 Keep symbol's multiple aliases within single attribute separated by comma
* 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>
2014-06-20 11:56:49 +02:00
Mark Wielaard
0608454a73 DW_TAG_mutable_type doesn't exist.
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>
2014-06-18 21:34:37 +02:00
Dodji Seketeli
d1843bb3b3 Look at first parm type and artificial-ness to detect static-ness
* 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>
2014-06-05 15:13:32 +02:00
Dodji Seketeli
c4e7f9792d Harden debug info path management & better error reporting
* 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>
2014-06-04 16:30:18 +02:00
Dodji Seketeli
3153f4c83a Do not choke on AR archives
* tools/abg-tools-utils.h (file_type::FILE_TYPE_AR): New enumerator.
	* tools/abg-tools-utils.cc (guess_file_type): Recognize AR archive
	files.
	* tools/bidiff.cc (main): Support AR archives.
	* tools/bidw.cc (main): Likewise.
	* tools/bilint.cc (main): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-06-02 17:05:05 +02:00
Dodji Seketeli
18b13d97e1 Honor linkage name showing when displaying added/removed member functions
* src/abg-comparison.cc (represent): Take a diff_context.  If
	instructed to show linkage names, show the linkage name of the
	member function.
	(class_diff::report): Adjust for the new signature of represent().

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-30 09:46:43 +02:00
Dodji Seketeli
9ed00db0a2 Make bidiff filter output and display symbol names by default
* tools/bidiff.cc (options::options): Initialize
	options::show_linkage_names to true and
	options::show_harmful_changes to false.
	(parse_command_line): Change --linkage-names into
	--no-linkage-names as the linkage names are now displayed by
	default.  Change --no-harmless into --harmless as harmless changes
	are now filtered by default.
	(display_usage): Update help string for the --linkage-names ->
	--no-linkage-names and --no-harmful -> --harmful change.
	* tests/test-diff-filter.cc: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-30 09:33:52 +02:00
Dodji Seketeli
76bfae5aac Ensure added/removed member functions have their symbols added/removed
* include/abg-comparison.h (diff_context::{set_corpora,
	get_first_corpus, get_second_corpus}): Declare new member
	functions.
	* src/abg-comparison.cc (diff_context::{set_corpora,
	get_first_corpus, get_second_corpus}): Define them.
	(compute_diff): In the overload for corpus_sptr stick the corpora
	being compared, into the diff context.
	(class_diff::ensure_lookup_tables_populated): If a member function
	is allegedly removed, check that its underlying symbol is removed
	from the corpus as well.  Otherwise, consider that the member
	function hasn't been removed.  Likewise, if a member function is
	allegedly added, check that its underlying symbol has been added
	to the corpus as well.  Otherwise, consider that the member
	function hasn't been added.  The symbols can now be accessed
	through the two corpora that are now present in the diff context.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-29 18:15:48 +02:00
Dodji Seketeli
5350583ec1 Fix scope for DIEs with specification or abstract_origin attributes
* src/abg-dwarf-reader.cc (get_scope_for_die): If the DIE has a
	DW_AT_specification or DW_AT_abstract_origin attribute, get the
	scope of the referred-to DIE.
	(build_ir_node_from_die): For a variable DIE that has a
	DW_AT_{specification,abstract_origin} attribute, do not add the
	built variable IR node to its scope because it is already in a
	scope.  It's in a scope because that built variable is for the DIE
	that is referred-to by the DW_AT_{specification,abstract_origin}
	attribute.  Likewise for member functions.  Also, now,
	get_scope_for_die can return a class for a function DIE because
	get_scope_for_die now returns the *logical* scope of the DIE; that
	is, it follows DW_AT_{specification,abstract_origin} attributes.
	* tests/data/test-read-dwarf/test1.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-29 18:12:54 +02:00
Dodji Seketeli
e2d450176b Add a symbol database to the ABI Corpus & support symbol aliases
* include/abg-corpus.h (corpus::{g,s}et_{fun,var}_symbol_map{_sptr}):
	Declare new accessors.
	(corpus::lookup_{variable,function}_symbol): Declare new member
	functions.
	* src/abg-corpus.cc (corpus::{g,s}et_{fun,var}_symbol_map{_sptr}):
	Define new accessors.
	(corpus::lookup_{variable,function}_symbol): Define new member
	functions.
	* include/abg-ir.h (string_elf_symbol_sptr_map_type)
	(string_elf_symbol_sptr_map_sptr, elf_symbols)
	(string_elf_symbols_map_type, string_elf_symbols_map_sptr): New
	convenience typedefs.
	(elf_symbol::{get_main_symbol, is_main_symbol, get_next_alias,
	has_aliases, add_alias, get_id_string,
	get_name_and_version_from_id, operator=}): Declare new member
	functions.
	* src/abg-ir.cc (elf_symbol::{get_main_symbol, is_main_symbol,
	get_next_alias, has_aliases, add_alias, get_id_string,
	get_name_and_version_from_id, operator=}): Define new member
	functions.
	* include/abg-reader.h (read_corpus_from_file): Take a shared
	pointer to corpus.
	* src/abg-reader.cc (read_context::{g,s}et_corpus): Define these.
	(build_elf_symbol_db, build_elf_symbol_from_reference)
	(read_symbol_db_from_input): Define new functions.
	(read_corpus_from_input): Adjust.  Make it read symbol databases.
	(build_elf_symbol): Harden this.
	(build_{var,function}_decl): Read the symbol reference.  Do not
	read the local symbol serialization anymore.
	(read_corpus_from_archive): Adjust.
	(read_corpus_from_file): Take a reference to a shared pointer to
	corpus, rather than a reference to the corpus.
	(read_corpus_from_native_xml): Only keep the overload that returns
	a corpus.  Set the current context with the corpus.
	* src/abg-dwarf-reader.cc (addr_elf_symbol_sptr_map_type)
	(addr_elf_symbol_sptr_map_sptr): New convenience typedefs.
	(read_context::{fun_sym_addr_sym_index_map_,
	var_sym_addr_sym_index_map_): Remove.
	(read_context::{fun,var}_addr_sym_map_): New.  Replace the above
	that got removed.
	(read_context::{var,fun}_syms_): New.
	(read_context::lookup_elf_{fn,var}_symbol_from_address): Adjust.
	(read_context::{fun,var}_addr_sym_map{_sptr}): New.
	(read_context::{fun,var}_syms{_sptr}): New.
	(read_context::load_symbol_maps): Replace
	read_context::load_symbol_addr_to_index_maps.  Adjust to load all
	the new maps.
	(read_context::maybe_load_symbol_maps): New.
	(read_debug_info_into_corpus): Renamed build_corpus into this.
	Update to load symbol maps and set it to the corpus.
	* src/abg-writer.cc (write_context::get_fun_symbol_map): New
	accessor.
	(write_elf_symbol_aliases, write_elf_symbol_reference)
	(write_elf_symbols_table): Define new static functions.
	(write_var_decl): Write the reference to the underlying symbol of
	the variable.  Do not write the full symbol here anymore.
	(write_function_decl):  Likewise, write the reference to the
	underlying symbol of the function.  Do not write the full symbol
	here anymore.
	(write_corpus_to_native_xml): Write the symbol databases at the
	beginning of the corpus document.
	* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): Now that the
	corpus has symbols, check if a the symbol of an allegedly deleted
	function (resp. variable) is deleted; if not, then do not report
	the function (resp. variable) as deleted.  Similarly, check if the
	symbol of an allegedly added function (resp. variable) is added.
	if not, the do not report the function (resp. variable) as added.
	* tests/test-write-read-archive.cc (main): Adjust.
	* tools/biar.cc (extract_tus_from_archive): Likewise.
	* tests/data/test-diff-filter/test9-report.txt: Adjust.
	* tests/data/test-read-dwarf/test0.abi: Likewise.
	* tests/data/test-read-dwarf/test1.abi: Likewise.
	* tests/data/test-read-dwarf/test2.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-28 16:33:35 +02:00
Dodji Seketeli
9a30bbf8c0 Rename 'symbol' in fn names to 'public decl' in abg-corpus.{cc,h}
* src/abg-corpus.cc (lots of places): Rename references to
	'symbol' in function & variable names to 'public_decl'.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-22 13:40:49 +02:00
Dodji Seketeli
cf80e9d378 Support debug info files being outside the expected system directories
* 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>
2014-05-22 13:14:44 +02:00
Dodji Seketeli
97820d1a88 Fix detection of destructors
* src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Simply
	detect that the destructor starts with a '~'.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-21 12:38:42 +02:00
Dodji Seketeli
0237455e57 Add clone in the scope of the cloned decl they logically belong to
* src/abg-dwarf-reader.cc (build_ir_node_from_die): Do not try to
	add the cloned function/variable to the current scope because
	cloning should have added the decl into the scope of the cloned
	target.
	* src/abg-ir.cc ({var,function}_decl::clone): Insert the clone
	decl into the scope of the cloned decl.  My understanding is that
	it's where they belong.
	* tests/data/test-read-dwarf/test1.abi: Update this to incorporate
	all the abstract constructors/destructors *and* their clones into
	the classes where they belong.
	* tests/data/test-read-dwarf/test1.abi: Adjust for the abstract
	cdtor being added to the class, as well as their cloned concrete
	instances.
	* tests/data/test-read-dwarf/test2.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-21 12:25:45 +02:00
Dodji Seketeli
4d0de72a85 Support decl cloning when seeing DW_AT_abstract_origin
* include/abg-ir.h ({var,function}_decl::clone): New method.
	* src/abg-dwarf-reader.cc (die_die_attribute): Add a flag to avoid
	looking through DW_AT_abstract_origin attribute here.
	(build_function_decl): Set the linkage name from
	DW_AT_linkage_name if it's not set yet.
	(build_ir_node_from_die): For DW_TAG_{variable,subprogram}, when
	we see DW_AT_abstract_origin, clone the decl they refer to.
	Also, avoid dropping the DIE on the floor just because it doesn't
	have die_is_artificial here.
	* src/abg-ir.cc ({var,function}_decl::clone): Implement this.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-20 18:22:14 +02:00
Dodji Seketeli
c91461a8c8 Don't share types across TUs when DW_TAG_partial_unit are involved
* src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir):
	Clear the part of the context that needs to be per TU.
	(build_ir_node_from_die): Assert that this should not be called
	for partial and imported unit because for now our practical
	assumption is that DIEs under partial unit are lazily read only
	when referenced by DIEs that are under DW_TAG_compile_unit.
	* tests/Makefile.am: Add the new test files to the build system.
	* tests/data/test-read-dwarf/test2.so.abi: Fix the reference
	output here to avoid sharing types across TUs, making the output
	valid for bilint.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-19 21:35:56 +02:00
Dodji Seketeli
c469546e45 Initial support for DW_TAG_partial_unit
* 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>
2014-05-19 17:26:40 +02:00
Dodji Seketeli
3567c0fe12 Re-build a test input file with debug info
* tests/data/test-lookup-syms/test1.so: Rebuild this with debug
	info.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-14 11:32:06 +02:00
Dodji Seketeli
335d8786b2 Serialize and de-serialize elf symbols for var & function decls
* abg-ir.h (string_to_elf_symbol_type, string_to_elf_symbol_binding):
	Declare new entry points.
	* src/abg-ir.cc (string_to_elf_symbol_type)
	(string_to_elf_symbol_binding): Define new entry points.
	* include/abg-libxml-utils.h (xml_char_sptr_to_string): Declare
	new entry points.
	* src/abg-libxml-utils.cc (xml_char_sptr_to_string): Define new
	entry points.
	* src/abg-reader.cc (read_elf_symbol_type)
	(read_elf_symbol_binding, build_elf_symbol): Define new static
	functions.
	(build_function_decl, build_var_decl): Use the new
	build_elf_symbol and set the symbol to the function.  Flag the
	function as having a public symbol in the symbol table if the
	symbol is public.
	* src/abg-writer.cc (write_elf_symbol_type)
	(write_elf_symbol_binding, write_elf_symbol): Define new static
	functions.
	(write_var_decl, write_function_decl): Use the new
	write_elf_symbol to serialize the symbol for the decl.
	* tests/data/test-read-dwarf/test[01].abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-14 11:19:34 +02:00
Dodji Seketeli
3e9cd9cd81 Don't crash when de-serializing an empty function parm xml node
* src/abg-reader.cc (build_function_parameter): Do not crash if
	the xml node is NULL.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-14 11:19:33 +02:00
Dodji Seketeli
2c60959d8f Fix a typo in serializing a decl_base::binding
* src/abg-ir.cc (operator<<(std::ostream&, decl_base::binding)):
	Fix a typo here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-14 11:01:24 +02:00
Dodji Seketeli
a286a96dd3 Add a help string for the --no-absolute-path option of bisym
* tools/bisym.cc (show_help): Add a missing help string.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-14 11:00:28 +02:00
Dodji Seketeli
dd23240e4e Do not try to use ELF hash tables in demangling lookup mode
* src/abg-dwarf-reader.cc (lookup_symbol_from_elf): If in
	demangling mode, do not use ELF hash tables.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-13 12:33:57 +02:00
Dodji Seketeli
61df20d749 Use the proper symbol table for and set linkage_name to symbol name
* src/abg-dwarf-reader.cc (find_symbol_table_section): Return the
	.symtab if we are looking at an executable or relocatable file and
	.dynsym if we are looking at a DSO.
	(find_symbol_table_section_index): Likewise.  Implement this in
	terms of find_symbol_table_section.
	(build_{function,var}_decl): Set the linkage_name to the symbol
	name, if the symbol name is not empty.
	* tests/data/test-diff-filter/test9-report.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-13 11:08:34 +02:00
Dodji Seketeli
01269740b3 Remove redundant "'" around linkage names in diff reports
* src/abg-comparison.cc (corpus_diff::report): Remove the
	redundant "'" from the linkage names in the diff.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-13 10:54:46 +02:00
Dodji Seketeli
ce1278c3da Initial support for elf symbol (versionning) during decl comparison
* include/abg-fwd.h (get_linkage_name): Remove.
	* include/abg-dwarf-reader.h (enum symbol_type)
	(enum symbol_binding): Move these into abg-ir.h.
	(lookup_symbol_from_elf, lookup_public_function_symbol_from_elf):
	Adjust.
	* src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr):
	Declare this before using it.
	(die_address_attribute, die_location_address)
	(stt_to_elf_symbol_type, stb_to_elf_symbol_binding)
	(find_hash_table_section_index, find_symbol_table_section)
	(find_symbol_table_section_index, find_text_section)
	(find_bss_section, compare_symbol_name)
	(get_symbol_versionning_sections get_version_for_symbol)
	(lookup_symbol_from_sysv_hash_tab)
	(lookup_symbol_from_gnu_hash_tab, get_elf_class_size_in_bytes)
	(bloom_word_at, setup_gnu_ht, lookup_symbol_from_elf_hash_tab)
	(lookup_symbol_from_symtab, maybe_adjust_fn_sym_address)
	(maybe_adjust_var_sym_address): New static functions.
	(enum hash_table_kind): New enum.
	(struct gnu_ht): New struct.
	(read_context::var_decls_to_add_): Renamed var_decls_to_add into
	this.
	(read_context::{fun, var}_sym_addr_sym_index_map_): New member.
	(read_context::{lookup_symbol_from_elf,
	lookup_elf_symbol_from_index, lookup_elf_fn_symbol_from_address,
	lookup_elf_var_symbol_from_address, fun_sym_addr_sym_index_map,
	var_sym_addr_sym_index_map, load_symbol_addr_to_index_maps,
	get_function_address, get_variable_address}): New member
	functions.
	(read_context::lookup_public_{variable,
	function}_symbol_from_elf): Adjust.
	(op_pushes_constant_value): Fix a bug here.
	(lookup_symbol_from_elf): Adjust.  Support cases where there is no
	elf hash table, e.g, for relocatable files.
	(lookup_public_function_symbol_from_elf)
	(lookup_public_variable_symbol_from_elf): Adjust.
	(build_var_decl): Allow updating the var_decl to associate it with
	its underlying symbol.  In that case, if the linkage name is not
	set, set it to the symbol name.
	(build_function_decl): Likewise for function_decl.
	(operator<<(std::ostream&, symbol_type)):
	(operator<<(std::ostream&, symbol_binding)): Move these do
	abg-ir.cc.
	* include/abg-ir.h (class elf_symbol): Declare new class.  Move
	enum symbol_binding and enum symbol_type (from abg-dwarf-reader.h) to
	elf_symbol::binding and elf_symbol::type here.
	(operator<<(std::ostream&, elf_symbol::type))
	(operator<<(std::ostream&, elf_symbol::binding))
	(operator==(const elf_symbol_sptr, const elf_symbol_sptr)): New
	operators.
	(class elf_symbol::version): Declare new class.
	(class var_decl): Make this pimpl, and add ...
	(var_decl::{g,s}et_symbol): ... new member functions.
	(class function_decl): Likewise, make this pimpl and add ...
	(function_decl::{g,s}et_symbol): ... new member functions.
	* src/abg-ir.cc (struct elf_symbol, elf_symbol::priv): New
	types.
	(elf_symbol::*): Lots of new members and member functions.
	(operator==(const elf_symbol_sptr, const elf_symbol_sptr)): New.
	(operator<<(std::ostream&, elf_symbol::type)): New.
	(operator<<(std::ostream&, elf_symbol::binding)): New.
	(elf_symbol::version::priv): New type.
	(elf_symbol::version::*): Lots of member functions.
	(get_linkage_name): Removed.
	(var_decl::priv): New type.  Pimplify the thing.
	(var_decl::{s,g}et_symbol): New.
	(var_decl::operator==): Take symbols in account in the comparison.
	(function_decl::priv): New type.
	(function_decl::*): Pimplify.
	(function_decl::{s,g}et_symbol): New.
	(function_decl::operator==): Take symbols in account in the
	comparison.
	* include/abg-comparison.h (diff_context::show_linkage_name): New
	member function.
	* src/abg-comparison.cc (diff_context::priv::show_linkage_name_):
	New member.
	(diff_context::priv::priv): Initialize it.
	(diff_context::show_linkage_names): New member function.
	(corpus_diff::report): If the user used --show-linkage-names,
	display the linkage name after the name of the functions.  Add
	missing "'" in the some spots.
	* tools/bidiff.cc (options.show_linkage_names): New member.
	(display_usage, parse_command_line): Support --linkage-names.
	* tools/bisym.cc (show_help): Add '\n' at the end of help string
	for --demangle.  Add --no-absolute-path option.
	(parse_command_line): Support --no-absolute-path.
	(main): Adjust for symbol (versionning) support.  Consider that
	the program successfully completed even when the symbol wasn't
	found.  Support --no-absolute-path.
	* tests/data/test-lookup-syms/test0-report.txt: New.
	* tests/data/test-lookup-syms/test01-report.txt: New.
	* tests/data/test-lookup-syms/test02-report.txt: New.
	* tests/data/test-read-dwarf/test0.abi: Adjust.
	* tests/data/test-read-dwarf/test1.abi: Adjust.
	* tests/data/test-diff-dwarf/test7-report.txt: Adjust.
	* tests/data/test-diff-filter/test10-report.txt: Adjust.
	* tests/data/test-diff-filter/test12-report.txt: Adjust.
	* tests/data/test-lookup-syms/test1-[123]-report.txt: New.
	* tests/data/test-lookup-syms/test1.c: New.
	* tests/data/test-lookup-syms/test1.version-script: New.
	* tests/test-lookup-syms.cc: Adjust for new tests.
	* test/Makefile.am: Adjust makefile.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-12 16:09:47 +02:00
Dodji Seketeli
bdf9e956d8 Rename decl_base::get_mangled_name into decl_base::get_linkage_name
* include/abg-ir.h (decl_base::get_linkage_name): Renamed
	decl_base::get_mangled_name into this.
	* src/abg-comparison.cc
	(class_diff::ensure_lookup_tables_populated)
	(function_decl_diff::report, type_decl_diff::report)
	(corpus_diff::priv::ensure_lookup_tables_populated)
	(corpus_diff::report, compute_diff): Adjust.
	* src/abg-corpus.cc ({var_comp, func_comp}::operator()): Likewise.
	(corpus::priv::build_symbol_table): Likewise.
	* src/abg-dwarf-reader.cc (die_linkage_name): Renamed
	die_mangled_name into this.
	(die_loc_and_name, build_translation_unit_and_add_to_ir)
	(build_namespace_decl_and_add_to_ir, build_type_decl)
	(build_enum_type, build_class_type_and_add_to_ir)
	(build_typedef_type, build_var_decl, build_function_decl, ): Adjust.
	* src/abg-hash.cc (decl_base:#️⃣:operator()): Likewise.
	* src/abg-ir.cc (decl_base::priv::linkage_name_): Renamed
	decl_base::priv::mangled_name_ into this.
	(decl_base::priv::priv, decl_base::{decl_base, operator==})
	(get_linkage_name, typedef_decl::typedef_decl, var_decl::var_decl)
	(function_decl::function_decl, class_decl::base_spec::base_spec)
	(class_decl::method_decl::method_decl): Adjust.
	(decl_base::{g,s}et_linkage_name): Renamed
	decl_base::{g,s}et_mangled_name into this.
	* src/abg-writer.cc (write_decl, write_typedef_decl)
	(write_var_decl, write_function_decl, dump): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-11 19:22:00 +02:00
Dodji Seketeli
46f81cc6e0 Drop symbols not global in a symtab from corpus symtab
* src/abg-corpus.cc (corpus_priv::build_symbol_table): If a
	function or variable symbol is not public (global or weak) and
	present in an elf symbol table, drop it from the corpus symbol
	table.  As a result functions are variables (not present in the
	elf symbol tables) that we were previously taking in account are
	not dropped on the floor, leading to much less noise.
	* tests/data/test-diff-dwarf/test0-v0.cc: Update to avoid
	generating inline functions.
	* tests/data/test-diff-dwarf/test0-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test0-v1.cc: Likewise.
	* tests/data/test-diff-dwarf/test0-v1.o: Likewise.
	* tests/data/test-diff-dwarf/test7-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test7-v1.cc: Likewise.
	* tests/data/test-diff-dwarf/test7-v1.o: Likewise.
	* tests/data/test-diff-dwarf/test8-v0.cc: Likewise.
	* tests/data/test-diff-dwarf/test8-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test8-v1.cc: Likewise.
	* tests/data/test-diff-dwarf/test8-v1.o: Likewise.
	* tests/data/test-diff-filter/test0-v0.cc: Likewise.
	* tests/data/test-diff-filter/test0-v0.o: Likewise.
	* tests/data/test-diff-filter/test0-v1.cc: Likewise.
	* tests/data/test-diff-filter/test0-v1.o: Likewise.
	* tests/data/test-diff-filter/test10-v0.cc: Likewise.
	* tests/data/test-diff-filter/test10-v0.o: Likewise.
	* tests/data/test-diff-filter/test10-report.txt: Likewise.
	* tests/data/test-diff-filter/test10-v1.o: Likewise.
	* tests/data/test-diff-filter/test13-v0.cc: Likewise.
	* tests/data/test-diff-filter/test13-v0.o: Likewise.
	* tests/data/test-diff-filter/test13-v1.cc: Likewise.
	* tests/data/test-diff-filter/test13-v1.o: Likewise.
	* tests/data/test-diff-filter/test2-v0.cc: Likewise.
	* tests/data/test-diff-filter/test2-v0.o: Likewise.
	* tests/data/test-diff-filter/test2-v1.cc: Likewise.
	* tests/data/test-diff-filter/test2-v1.o: Likewise.
	* tests/data/test-diff-filter/test4-v0.cc: Likewise.
	* tests/data/test-diff-filter/test4-v0.o: Likewise.
	* tests/data/test-diff-filter/test4-v1.cc: Likewise.
	* tests/data/test-diff-filter/test4-v1.o: Likewise.
	* tests/data/test-diff-filter/test9-v0.o: Likewise.
	* tests/data/test-diff-filter/test9-v1.cc: Likewise.
	* tests/data/test-diff-filter/test9-v1.o: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 21:32:39 +02:00
Dodji Seketeli
aeb5cb10b0 Fix mangled name setting for static data members from DWARF
* src/abg-dwarf-reader.cc (build_var_decl): Support adding
	properties to an existing var_decl.  For now just add mangled
	name.
	(build_ir_node_from_die): Accept DW_TAG_member too.  This helps
	for when this function is used to add additional properties to an
	existing DW_TAG_member representing a static data member.  Then,
	use build_var_decl to really add the value of the additional
	mangled name property.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 20:50:25 +02:00
Dodji Seketeli
4a761d2a5a Always show pretty representation of variables in report
* src/abg-comparison.cc (corpus_diff::report): Display the pretty
	representation of the variable, no matter what.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 20:50:25 +02:00
Dodji Seketeli
1e55727b98 Set "is_in_public_symbol_table" property for vars & fns
* src/abg-dwarf-reader.cc (build_var_decl, build_function_decl):
	Set the "is_in_public_symbol_table" property for the variable or
	function decl.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 19:32:04 +02:00
Dodji Seketeli
12c777681d Support symbol lookups from ELF
* include/abg-dwarf-reader.h (symbol_type, symbol_binding): New
	enums.
	(operator<<): Declare new overloads for the new enums above.
	(lookup_symbol_from_elf, lookup_public_function_symbol_from_elf):
	Declare new entry points.
	* src/abg-dwarf-reader.cc (lookup_symbol_from_elf)
	(lookup_public_function_symbol_from_elf)
	(lookup_public_variable_symbol_from_elf): Define new static
	functions.
	(read_context::elf_{module_, handle}_): New data members.
	(read_context::{elf_module, elf_handle}): New accessors.
	(read_context::load_debug_info): Store the elf module into
	read_context::_elf_module_.  Adjust.
	(read_context::{lookup_symbol_from_elf,
	lookup_public_function_symbol_from_elf,
	lookup_public_variable_symbol_from_elf}): New member functions.
	(lookup_symbol_from_elf, lookup_public_function_symbol_from_elf)
	(operator<<): Define public entry points.
	* tools/bisym.cc: New tool to lookup a symbol in an elf file.
	* tools/Makefile.am: Add the bisym.cc source file to the
	distribution and arrange to compile it into a 'bisym' executable.
	* tests/test-lookup-syms.cc: New test harness.
	* tests/data/test-lookup-syms/test0-report.txt: New test input
	for the harness above.
	* tests/data/test-lookup-syms/test0.cc: Likewise.
	* tests/data/test-lookup-syms/test0.o: Likewise
	* tests/data/test-lookup-syms/test01-report.txt: Likewise.
	* tests/data/test-lookup-syms/test02-report.txt: Likewise.
	* tests/Makefile.am: Build the new runtestlookupsyms test and add
	the new files to the distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 17:56:40 +02:00
Dodji Seketeli
2ce2eff68e Add corpus::{s,g}et_origin accessors
* include/abg-corpus.h (enum corpus::origin): New enum.
	(corpus::{g,s}et_origin): New accessors.
	* src/abg-corpus.cc (corpus::priv::origin): New data member.
	(corpus::priv::is_symbol_table_built): Move this up.
	(corpus::priv::priv): Adjust.
	(corpus::{g,s}et_origin): Define accessors.
	* src/abg-dwarf-reader.cc (read_corpus_from_elf): Set the corpus
	origin.  Also set the path.  Oops.
	* src/abg-reader.cc (read_corpus_from_input)
	(read_corpus_from_archive): Set the corpus origin.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 17:22:11 +02:00
Dodji Seketeli
0d55047a4e Add a get_linkage_name function.
* include/abg-fwd.h (is_at_global_scope): Declare a new overload.
	(get_linkage_name): Declare ...
	* src/abg-ir.cc (get_linkage_name): ... these new entry points.
	(is_at_global_scope): Define these new overloads useful for the
	new get_linkage_name.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 17:14:30 +02:00
Dodji Seketeli
e2c776f4bc Pimplify decl_base and add decl_base::{s,g}et_is_in_public_symbol_table
* include/abg-ir.h (struct decl_base::priv): New pimpl type.
	(decl_base::priv_): New pimpl.
	(decl_base::{hashing_started, peek_hash_value,
	peek_qualified_name, set_qualified_name}): Declare new protected
	methods.
	(decl_base::{get_context_rel, set_qualified_name, get_location,
	set_location, set_name, set_mangled_name, get_visibility,
	set_visibility}): Move these out-of-line.
	(decl_base::{g,s}et_is_public_symbol_table):
	(class_decl::hashing_started): Remove this as we now have
	decl_base::hashing_started.
	(decl_base::{hash_, hashing_started, location_, context_, name_,
	qualified_parent_name_, qualified_name_, mangled_name_,
	visibility_}): Move all these members into the new ...
	* src/abg-ir.cc (struct decl_base::priv): ... pimpl type.
	(decl_base::decl_base): Move these out-of-line here.  Adjust the
	other overloads.
	(decl_base::{hashing_started, peek_hash_value,
	peek_qualified_name, set_qualified_name}): Define these new
	protected methods.
	(decl_base::{get_context_rel, set_context_rel, get_location,
	set_location, set_name, get_mangled_name, set_mangled_name,
	get_visibility, set_visibility}): Define these out-of-line here.
	(decl_base::{get_hash, set_hash, get_scope,
	get_qualified_parent_name, get_qualified_name, operator==,
	set_scope}): Adjust.
	(qualified_type_def::get_qualified_name): Likewise.
	(pointer_type_def::get_qualified_name): Likewise.
	(reference_type_def::get_qualified_name): Likewise.
	(var_decl::set_scope): Likewise.
	(class_decl::base_spec): Likewise.
	(class_decl::method_decl::set_scope): Likewise.
	(decl_base::{g,s}et_is_in_public_symbol_table): Define new accessors.
	* src/abg-hash.cc ({decl_base, type_decl, scope_decl,
	scope_type_decl, qualified_type_def, pointer_type_def,
	reference_type_def, enum_type_decl, typedef_decl, var_decl,
	class_decl}:#️⃣:operator): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-21 17:13:46 +02:00
Dodji Seketeli
262c39f763 Categorize base class changes as SIZE_OR_OFFSET_CHANGE_CATEGORY
* include/abg-comparison.h (class_diff::{deleted, inserted,
	changed}_bases): Declare new member functions ...
	* src/abg-comparison.cc ((class_diff::{deleted, inserted,
	changed}_bases)): ... and define them.
	* src/abg-comp-filter.cc (base_classes_added_or_removed): Define
	new static functions.
	(harmless_filter): Categorize base classes added or removed.
	* tests/data/test-diff-dwarf/test8-report.txt: New test input.
	* tests/data/test-diff-dwarf/test8-v0.cc: Likewise.
	* tests/data/test-diff-dwarf/test8-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test8-v1.cc: Likewise.
	* tests/data/test-diff-dwarf/test8-v1.o: Likewise.
	* tests/data/test-diff-filter/test13-report.txt: New test input.
	* tests/data/test-diff-filter/test13-v0.cc: Likewise.
	* tests/data/test-diff-filter/test13-v0.o: Likewise.
	* tests/data/test-diff-filter/test13-v1.cc: Likewise.
	* tests/data/test-diff-filter/test13-v1.o: Likewise.
	* tests/Makefile.am: Add the new files above to the source distribution.
	* tests/test-diff-dwarf.cc: Use the new relevant input above to
	run more tests.
	* tests/test-diff-filter.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 15:37:53 +02:00
Dodji Seketeli
a436ee1094 Fix class diff reporting issues for base classes
* src/abg-comparison.cc (class_diff::report): For base classes,
	report their pretty representation.  Do not try to report a the
	diff of a changed base class that got filtered out.  Avoid
	emitting too many vertical white spaces.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 15:14:56 +02:00
Dodji Seketeli
f66dda8f1b Simplify SIZE_OR_OFFSET_CHANGE_CATEGORY categorizing
* src/abg-comp-filter.cc (harmful_filter::visit): Now that
	type_size_changed is correctly geared to not be fulled by
	decl-only classes, there is no need for its caller to handle that
	case.  And data_member_offset_changed ain't affected by decl-only
	classes anyway.  So the code is now much simpler.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 14:24:25 +02:00
Dodji Seketeli
b7ae89e325 Fix API doc for static_data_member_type_size_changed
* src/abg-comp-filter.cc (static_data_member_type_size_changed):
	Fix API doc comment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 13:27:23 +02:00
Dodji Seketeli
fffb903ea0 Don't blindly drop DIEs defined in the scope of a function
* src/abg-dwarf-reader.cc (get_scope_for_die): Do not drop a DIE
	on the floor just because it is in the scope of a function.  We
	were dropping a function parameter because its type is a typedef
	defined right before the parameter, in the scope of the function.
	Urgh.  So with this change, that function parameter is not dropped
	anymore.  I have seen that happening in a DWARF generated by GCC
	4.7.1 on libstdc++.so.  Hard to come up with a regression test
	case for this one.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 13:21:40 +02:00
Dodji Seketeli
57ceb9e3d1 Useless code killing
* src/abg-comparison.cc (decls_equal::operator()(const decls_type,
	const decls_type)): Kill dead code.  Note that there is a proper
	equality operator for decl_base_sptr already.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 13:15:46 +02:00
Dodji Seketeli
e4820f9e33 File static data member changes in STATIC_DATA_MEMBER_CHANGE_CATEGORY
* include/abg-comparison.h
	(diff_category::STATIC_DATA_MEMBER_CHANGE_CATEGORY): New category.
	(diff_category::EVERYTHING_CATEGORY): Update
	* src/abg-comp-filter.cc (static_data_member_type_size_changed)
	(static_data_member_added_or_removed): Define new static
	functions.
	(harmless_filter::visit): Categorize changes to static data
	members as STATIC_DATA_MEMBER_CHANGE_CATEGORY.
	* tools/bidiff.cc (set_diff_context_from_opts):
	STATIC_DATA_MEMBER_CHANGE_CATEGORY is falls into the harmless
	group.
	* tests/data/test-diff-filter/test12-report.txt: New test input.
	* tests/data/test-diff-filter/test12-v0.cc: Likewise.
	* tests/data/test-diff-filter/test12-v0.o: Likewise.
	* tests/data/test-diff-filter/test12-v1.cc: Likewise.
	* tests/data/test-diff-filter/test12-v1.o: Likewise.
	* tools/bidiff.cc: Run this test with the additional input data
	above.
	* tests/Makefile.am: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 11:50:45 +02:00
Dodji Seketeli
fc6af95304 Fix typo in comments
* include/abg-comparison.h
	(diff_category::NON_VIRT_MEM_FUN_CHANGE_CATEGORY): Fix typo in
	comments.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 11:17:02 +02:00
Dodji Seketeli
d95eb0f682 Only non-static data member changes are SIZE_OR_OFFSET_CHANGE_CATEGORY
* src/abg-comp-filter.cc
	(non_static_data_member_type_size_changed): Renamed
	data_member_offset_changed into this.  Make sure the test detects
	changes on *non-static* data members only.
	(non_static_data_member_added_or_removed): Likewise for
	data_member_offset_changed that got renamed into this.
	(harmful_filter::visit): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-17 11:10:20 +02:00