Commit Graph

7 Commits

Author SHA1 Message Date
Dodji Seketeli
76837d1cbf Update copyright years
* include/abg-comp-filter.h: Update copyright years.
	* include/abg-comparison.h: Likewise.
	* include/abg-config.h: Likewise.
	* include/abg-corpus.h: Likewise.
	* include/abg-diff-utils.h: Likewise.
	* include/abg-dwarf-reader.h: Likewise.
	* include/abg-fwd.h: Likewise.
	* include/abg-hash.h: Likewise.
	* include/abg-ini.h: Likewise.
	* include/abg-ir.h: Likewise.
	* include/abg-libxml-utils.h: Likewise.
	* include/abg-libzip-utils.h: Likewise.
	* include/abg-reader.h: Likewise.
	* include/abg-sptr-utils.h: Likewise.
	* include/abg-traverse.h: Likewise.
	* include/abg-viz-common.h: Likewise.
	* include/abg-viz-dot.h: Likewise.
	* include/abg-viz-svg.h: Likewise.
	* include/abg-writer.h: Likewise.
	* src/abg-comp-filter.cc: Likewise.
	* src/abg-comparison.cc: Likewise.
	* src/abg-config.cc: Likewise.
	* src/abg-corpus.cc: Likewise.
	* src/abg-diff-utils.cc: Likewise.
	* src/abg-dwarf-reader.cc: Likewise.
	* src/abg-hash.cc: Likewise.
	* src/abg-ini.cc: Likewise.
	* src/abg-ir.cc: Likewise.
	* src/abg-libxml-utils.cc: Likewise.
	* src/abg-libzip-utils.cc: Likewise.
	* src/abg-reader.cc: Likewise.
	* src/abg-traverse.cc: Likewise.
	* src/abg-viz-common.cc: Likewise.
	* src/abg-viz-dot.cc: Likewise.
	* src/abg-viz-svg.cc: Likewise.
	* src/abg-writer.cc: Likewise.
	* tests/print-diff-tree.cc: Likewise.
	* tests/test-abidiff.cc: Likewise.
	* tests/test-alt-dwarf-file.cc: Likewise.
	* tests/test-core-diff.cc: Likewise.
	* tests/test-diff-dwarf.cc: Likewise.
	* tests/test-diff-filter.cc: Likewise.
	* tests/test-diff-suppr.cc: Likewise.
	* tests/test-diff2.cc: Likewise.
	* tests/test-ir-walker.cc: Likewise.
	* tests/test-lookup-syms.cc: Likewise.
	* tests/test-read-dwarf.cc: Likewise.
	* tests/test-read-write.cc: Likewise.
	* tests/test-utils.cc: Likewise.
	* tests/test-utils.h: Likewise.
	* tests/test-write-read-archive.cc: Likewise.
	* tools/abg-tools-utils.cc: Likewise.
	* tools/abg-tools-utils.h: Likewise.
	* tools/abiar.cc: Likewise.
	* tools/abidiff.cc: Likewise.
	* tools/abidw.cc: Likewise.
	* tools/abilint.cc: Likewise.
	* tools/abisym.cc: Likewise.
	* tools/binilint.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-07 17:52:10 +01: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
2c9fb3e70d Support new 'abi-corpus' native XML format (.abi)
* include/abg-reader.h (read_corpus_from_native_xml)
	(read_corpus_from_native_xml_file): Declare new entry points.
	* include/abg-writer.h (write_corpus_to_native_xml)
	(write_corpus_to_native_xml_file): Likewise.
	* src/abg-reader.cc (read_translation_unit_from_input): Renamed
	read_input into this.  Support new 'path' attribute for
	'abi-instr' XML element.
	(read_corpus_from_input): New static function.
	(read_translation_unit_from_file)
	(read_translation_unit_from_buffer)
	(read_translation_unit_from_istream): Update wrt read_input ->
	read_translation_unit_from_input.
	(read_corpus_from_native_xml, read_corpus_from_native_xml)
	(read_corpus_from_native_xml_file): Define new entry points.
	* src/abg-writer.cc (write_translation_unit): Write 'path'
	attribute into the 'abi-instr' xml element.
	(write_corpus_to_native_xml, write_corpus_to_native_xml_file):
	Define new entry points.
	* tools/abg-tools-utils.h (file_type::{FILE_TYPE_XML_CORPUS,
	FILE_TYPE_ZIP_CORPUS}): New enumerators.
	* tools/abg-tools-utils.cc (guess_file_type): Support detection of
	the new xml file format containing a document root 'abi-corpus'
	root element.
	* tools/bidiff.cc (main): Support diffing xml corpus-es and zip
	corpus-es.
	* tools/bidw.cc (main): Recognize elf files before reading them.
	* tools/bilint.cc (main): Support reading xml/zip corpus-es too.
	* tests/data/test-read-write/test[0-23].xml: Update 'path'
	attribute.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-01-07 14:12:26 +01:00
Dodji Seketeli
fbb6b1bc73 Initial support for diffing ABI corpus files
* include/abg-comparison.h (string_function_ptr_map)
	(changed_function_ptr, string_changed_function_ptr_map)
	(corpus_diff_sptr): New convenience typedefs.
	(translation_unit_diff): Add comments.
	(class corpus_diff): New type.
	(compute_diff): New overload for corpus_diff.
	* include/abg-corpus.h (corpus::{functions, variables}): New
	typedefs.
	(corpus::{operator==, get_functions, get_variables}): New members.
	* include/abg-diff-utils.h (struct deep_ptr_eq_functor): New
	functor.
	* include/abg-ir.h (translation_unit::operator==): New member
	equality operator.
	* src/abg-comparison.cc (struct corpus_diff::priv): New private
	struct holding the private members of corpus_diff.
	(corpus_diff::priv::{lookup_tables_empty, clear_lookup_tables,
	ensure_lookup_tables_populated}): Define new private member functions.
	(corpus_diff::{corpus_diff, first_corpus, second_corpus,
	function_changes, variable_changes, length, report}): New public members.
	(struct noop_deleter): New struct.
	(compute_diff): New implementation for corpus_diff.
	* src/abg-corpus.cc (struct corpus::priv): Renamed corpus::impl
	into this.  Add new fns, vars and is_symbol_table_built data
	members.
	(corpus::priv::build_symbol_table): New member function.
	(class symtab_build_visitor_type): New visitor type to build the
	symbol table.
	(struct func_comp, struct var_comp): New comparison functors.
	(corpus::priv::build_symbol_table): Define new member function.
	(corpus::{corpus, add, get_translation_units, operator==,
	get_functions, get_variables}): Define new members.
	* src/abg-ir.cc (translation_unit::operator==): Define new member
	equality operator.
	(operator==(translation_unit_sptr l, translation_unit_sptr r)):
	Define new equality operator.
	* tools/abg-tools-utils.h (enum file_type): New enum.
	(guess_file_type): Declare new function.
	* tools/abg-tools-utils.cc (guess_file_type): define new function.
	* tools/bidiff.cc (main): Guess the type of the files given in
	input and support elf files reading and diffing.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-12-23 14:05:19 +01:00
Dodji Seketeli
749611d2e8 Initial implementation of tu diffing & bidiff cmd line program
* include/abg-comparison.h (class translation_unit_diff): New type.
	(compute_diff): Make this take class_decl&, rather than
	class_decl_sptr.  Add new overloads for scope_decl& and
	translation_unit&.
	(report_changes): New overload for scope_diff& and
	translation_unit&.
	* src/abg-comparison.cc (struct class_decl_diff::priv): New type.
	(class class_decl_diff): Add comments to methods.
	(class translation_unit_diff): Implement methods.
	(compute_diff, report_changes): Implement the new overloads.
	(scope_diff::ensure_lookup_tables_populated): Fix a thinko here.
	* src/abg-ir.cc (is_var_decl): Add new predicate.
	* tools/abg-tools-utils.h (file_exists, is_regular_file)
	(check_file): Declare new functions.
	* tools/abg-tools-utils.cc (get_stat, file_exists, check_file)
	(is_regular_file): Define new functions.
	(is_dir): Use the new get_stat.
	* tools/bidiff.cc: New file.
	* tools/Makefile.am: Add tools/bidiff.cc to the build system; make it
	produce the bidiff tool.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:24:01 +01:00
Dodji Seketeli
0d738e2b95 Initial version of an archive manipulation program: biar
* tests/test-utils.h (is_dir, ensure_dir_path_created)
	(ensure_parent_dir_created): Move these directories manipulation
	utilities from here to ...
	* tools/abg-tools-utils.h (is_dir, ensure_dir_path_created)
	(ensure_parent_dir_created): ... here in this new file.
	(dir_name, base_name): Declare these new functions.
	* tests/test-utils.cc (is_dir, ensure_dir_path_created)
	(ensure_parent_dir_created): Likewise, move these to ...
	* tools/abg-tools-utils.cc (is_dir, ensure_dir_path_created)
	(ensure_parent_dir_created): ... here in this new file.
	(dir_name, base_name): Define these.
	* tools/Makefile.am: New file.  Create a new libtoolsutils.la
	static library with stuff from tools/abg-tools-utils.cc in it.
	Also create a new 'biar' program with the stuff from the new
	tools/biar.cc in it.
	* tools/biar.cc: New file.  Contains the code for the new "biar"
	archive manipulation command line utility.
	* tests/test-read-write.cc (main): Adjust for the change about
	ensure_parent_dir_created above.
	* tests/test-write-read-archive.cc (main): Likewise.
	* Makefile.am (SUBDIRS): Add the new tools/ sub-directory to the
	build system.
	* configure.ac (AC_CONFIG_FILES): Generate tools/Makefile.
	* tests/Makefile.am: Make libtestutils.la link with the new
	libtoolsutils.la.  Make sure to express the dependencies between
	libtestutils.la and the binaries that depend on it.  Otherwise
	parallel builds can go awry.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 17:08:47 +02:00