mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-20 00:40:05 +00:00
5df40e91ce
Directly using elfutils from abipkgdiff.cc feels like a taping into the wrong abstraction layer from this level. So this patch moves the determination of the type of elf file into abg-dwarf-reader.cc and uses it from there. The patch also simplifies the instantiation of types elf_file and package, from abipkgdiff.cc. * abg-dwarf-reader.h (enum elf_type): Move this declaration here from abipkgdiff.cc to here. (get_type_of_elf_file): Declare this new function. (get_soname_from_elf): Change this to take a path to the elf file rather than a Elf* handler. So now to use this, the user doesn't have to get her hand dirty with elfutils. * src/abg-dwarf-reader.cc (get_soname_from_elf): Change this to take a path to the elf file rather than a Elf* handler. (elf_file_type): Move this static function here, from abipkgdiff.cc. (get_type_of_elf_file): New function. This has been factorized out of create_maps_of_package_content() in abipkgdiff.cc. * tools/abipkgdiff.cc (class elf_file): Changed struct elf_file into this. Make the default constructor private. (elf_file::elf_file): Change the constructor to just take the path to the elf_file. The base name, soname and elf file type are now computed from the path file, in the constructor. This makes instantiation much much easier from the point of view of the user of the type. (struct abi_diff): Renamed struct abi_changes into this. (abi_diff::has_changes): Define new member function. (abi_diffs): Remove this global variable. (package::package): Remove the elf file type from the set of parameters of this constructor. Rather, compute that elf file type from the path to the elf file, in the constructor. Again, this eases the use of the type. (elf_file_type): Remove this from here, as it got moved to abg-dwarf-reader.cc. (compare): In the elf_file overload, return true if the comparison yields ABI changes. (create_maps_of_package_content): Do not fiddle with elfutils stuff here. Rather, just instantiate elf_file and the analyzing of the file magically happens. (compare): Make the package overload take an abi_diff as output parameter, rather than populating a global variable in return. (compare): Add an other overload for package that doesn't take the abi_diff as output parameter and write it in terms of the previous one. (main): Adjust as the instantiation of package is now simpler. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
abg-comp-filter.h | ||
abg-comparison.h | ||
abg-config.h | ||
abg-corpus.h | ||
abg-diff-utils.h | ||
abg-dwarf-reader.h | ||
abg-fwd.h | ||
abg-hash.h | ||
abg-ini.h | ||
abg-ir.h | ||
abg-libxml-utils.h | ||
abg-libzip-utils.h | ||
abg-reader.h | ||
abg-sptr-utils.h | ||
abg-tools-utils.h | ||
abg-traverse.h | ||
abg-version.h.in | ||
abg-viz-common.h | ||
abg-viz-dot.h | ||
abg-viz-svg.h | ||
abg-writer.h | ||
Makefile.am |