Commit Graph

1363 Commits

Author SHA1 Message Date
Dodji Seketeli
e25159b4b9 Debug type-decl serialization
* src/abg-writer.cc (do_indent): New function.
	(write_corpus&): Use do_indent.  Don't forget to close the
	abi-instr tag.
	(write_type_decl): Use do_indent.  Handle null decls pointers.
	Emit the id at the end of the element.
	(write_namespace_decl): Use do_indent.  Handle null decls
	pointers.
	* tests/test-utils.{h,cc} (get_src_dir,get_build_dir): Constify
	the returned reference to string.
	(is_dir, ensure_dir_path_created, ensure_parent_dir_created): New
	function definitions.
	* tests/test-read-write.cc (main): Augment the test to serialize
	the corpus too.
2013-03-22 16:53:26 +01:00
Dodji Seketeli
fc27d10cee Debugged type-decl de-serialization
* src/abg-ir.cc (namespace_decl::~namespace_decl): Add this
	missing virtual constructor definition.
	* src/abg-reader.cc (read_context::{get_cur_decl,pop_decl}):
	Return a null pointer when the decls stack is empty.
	(update_read_context): Don't try to de-reference a NULL cur_decl.
	(read_input): Don't try to poke at file validity here.  What was I
	thinking.  Really test for advance_cursor to return 1, expressing
	success.
	* src/abg-reader.h (read_file):  Fix style.
	* Makefile.am: Add tests sub-directory.
	* configure.ac: Build with debugging-friendly options if the
	ABIGAIL_DEBUG env variable is set.  Generate tests/Makefile.
	* tests/Makefile.am: New file.
	* tests/test-read-write.cc: Likewise.
	* tests/test-utils.{h,cc}: Likewise.
	* tests/data/test-read-write/input0.xml: Likewise.
2013-03-21 23:57:22 +01:00
Dodji Seketeli
a80b09f912 Initial implementation of serialization of basic types and namespaces.
* src/Makefile.am: Add abg-writer.{h,cc} and abg-config.{h,cc}.
	* src/abg-config.{h,cc}: New files.
	* src/abg-corpus.h (abi_corpus::decls_type): New typedef.
	(abi_corpus::{add,get_decls,get_loc_mgr}): Fix style.
	(abi_corpus::is_empty): Declare new function.
	* src/abg-corpus.cc (abi_corpus::add): really add the declaration
	to the corpus.
	(abi_corpus::is_empty): Define new function.
	* src/abg-ir.{h,cc} (location_manager::expand_location): Consti-fy
	this function.
	* src/abg-reader.cc (read_file): Add a corpus parameter.
	* src/abg-serialize.cc: Delete this file.
	* src/abg-writer.h (write_to_ostream): Rename write into this.
	Make it take a corpus and an ostream as parameters.
	* abg-writer.cc: New file.
2013-03-21 14:43:30 +01:00
Dodji Seketeli
8e225db39a Parse type-decl and namespace-decl elements
* configure.ac: Add libxml2 dependencies.
	* src/abg-corpus.{h,cc}: New files.
	* src/abg-hash.{h,cc}: Likewise.
	* src/abg-libxml-utils.{h,cc}: Likewise.
	* src/abg-reader.{h,cc}: Likewise.
	* src/abg-serialize.{h,cc}: Likewise.
	* src/abg-writer.h: Likewise.
	* src/Makefile.am: Build the new files above.
	* src/abg-ir.h (class location): Add public accessors for the value, and
	a truth operator.  Make the methods be inline.
	(class decl_base): Renamed decl into this.  Renamed what_decl_kind
	into what_kind. Renamed get_context into get_scope.  Add virtual
	destructor, accessors for location and name.
	(class {scope_decl, type_base, type_decl} ): Add virtual dtor.
	Re-style.
	(struct {decl_base_hash, type_decl_hash}): New hashing functors.
	(class {scope_type_decl, namespace_decl}): Add virtual dtor.
	* src/abg-ir.cc (location::*): Remove location definitions.  There
	are now inline in the header.
	(class decl_base): Renamed decl into this.  Remove most of the
	definitions from here as their are now inline in the header.
	(scope_decl::~scope_decl, type_base::~type_base)
	(type_decl::~type_decl, scope_type_decl::~scope_type_decl): New
	definitions.
2013-03-08 14:31:37 +01:00
Dodji Seketeli
e20615bf9f Updated hierarchy up to namespace_decl
* src/abg-ir.h (location):  Make the default ctor public.
	(class decl): Declare data member and proper constructors.  Make the
	context be a shared_ptr.  Add a kind data member to avoid RTTI for
	now.
	(class scope_decl): Added protected constructor to handle the kind data
	member.
	(class type_base): Add data members proper and clean the iface up.
	(class type_decl, scope_type_decl, namespace_decl): Iron out
	constructors.
	* src/abg-ir.cc (class location): Fix style.
	(class decl, scope_decl, type_base, type_decl, scope_type_decl)
	(namespace_decl): Define these types.
2013-03-04 16:29:31 +01:00
Dodji Seketeli
19cde0efb7 Add missing autoconfiscation files into version control
* config.guess: Added to VCS.
	* config.sub: Likewise.
	* depcomp: Likewise.
	* install-sh: Likewise.
	* ltmain.sh: Likewise.
	* missing: Likewise
2013-03-01 00:47:49 +01:00
Dodji Seketeli
52864a54da Upload m4 file
* m4/: Import this directory into version control.
2013-03-01 00:44:18 +01:00
Dodji Seketeli
010f88d199 Create and expand locations
* src/abg-ir.h (class {location, location_manager, decl,
	scoped_decl, type_base, type_decl, scope_type_decl): Declare new
	types.
	* src/abg-ir.cc (class {location, location_manager}): Define new types.
2013-03-01 00:38:28 +01:00
Dodji Seketeli
b9ca3b4411 Adjust src/Makefile.am after some file rename
* src/Makefile.am: Update build system for renaming files from
	abgl-* into abg-*.
2013-03-01 00:36:17 +01:00
Dodji Seketeli
b8035bdf11 Update the README file
* README: Update.
2013-03-01 00:35:20 +01:00
Dodji Seketeli
6358c74a65 Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
Dodji Seketeli
c822ae122f Leave license stuff for later 2013-02-28 13:20:19 +01:00
Dodji Seketeli
d7d371a742 Initial import Abigail
This is the initial Import of the

    ABI Generic Analysis and Instrumentation Library
2013-02-28 11:42:57 +01:00