libabigail/doc/manuals/abidw.rst
Dodji Seketeli 7bcaf67504 Add a --stats to abidiff and abidw
For now, this new --stats emits diagnostics about the number of types
canonicalized at the very end of building the ABI corpus as well as
the number of types that were scheduled for late canonicalizing and
that couldn't be canonicalized.

	* include/abg-dwarf-reader.h (get_show_stats)
	(set_show_stats): New accessors for a new "show_stats" property of
	the dwarf reader context.
	* src/abg-dwarf-reader.cc: Include iostream to use std::cerr.
	(dwarf_reader::show_stats_): New data member.
	(dwarf_reader::dwarf_reader): Initialize it.
	(dwarf_reader::show_stats)
	(get_show_stats)
	(set_show_stats): Define new accessors.
	(dwarf_reader::die_type_map): Add const overload to this accessor.
	(dwarf_reader::lookup_type_from_die_offset): Make this accessor
	const.
	(dwarf_reader::add_late_canonicalized_types_stats): New member
	function.
	(dwarf_reader::perform_late_type_canonicalizing): Emit the
	statistics about late-canonicalized types if the user asked for
	it.
	* tools/abidiff.cc (options::show_stats): New data member.
	(options::options): Initialize it.
	(display_usage): Document it.
	(parse_command_line): Parse the new --stats option.
	(main): Create a dwarf reader context, set the show_stats to it
	and then use that context to read the corpora before diffing them.
	* tools/abidw.cc (options::show_stats): New data member.
	(options::options): Initialize it.
	(display_usage): Document it.
	(parse_command_line): Parse the new --stats option.
	(main): Set the show_stats to the dwarf reader context before
	using it.
	* doc/manuals/abidiff.rst: Update the manual.
	* doc/manuals/abidw.rst: Update the manual.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-20 13:25:42 +02:00

96 lines
3.1 KiB
ReStructuredText

======
abidw
======
abidw reads a shared library in `ELF`_ format and emits an XML
representation of its ABI to standard output. The emitted
representation includes all the globally defined functions and
variables, along with a complete representation of their types. It
also includes a representation of the globally defined ELF symbols of
the file. The input shared library must contain associated debug
information in `DWARF`_ format.
Invocation
==========
::
abidw [options] [<path-to-elf-file>]
Options
=======
* ``--help | -h``
Display a short help about the command and exit.
* ``--debug-info-dir | -d`` <*dir-path*>
In cases where the debug info for *path-to-elf-file* is in a
separate file that is located in a non-standard place, this tells
``abidw`` where to look for that debug info file.
Note that *dir-path* must point to the root directory under which
the debug information is arranged in a tree-like manner. Under
Red Hat based systems, that directory is usually
``<root>/usr/lib/debug``.
Note that this option is not mandatory for split debug information
installed by your system's package manager because then
``abidw`` knows where to find it.
* ``--out-file`` <*file-path*>
This option instructs ``abidw`` to emit the XML representation of
*path-to-elf-file* into the file *file-path*, rather than emitting
it to its standard output.
* ``--check-alternate-debug-info`` <*elf-path*>
If the debug info for the file *elf-path* contains a reference to
an `alternate debug info <alt-di-label>`_ file, ``abidw`` checks
that it can find that alternate debug info file. In that case, it
emits a meaningful success message mentioning the full path to the
alternate debug info file found. Otherwise, it emits an error
code.
* ``--check-alternate-debug-info-base-name`` <*elf-path*>
Like ``--check-alternate-debug-info``, but in the success message,
only mention the base name of the debug info file; not its full path.
* ``--load-all-types``
By default, ``libabigail`` (and thus ``abidw``) only loads types
that are reachable from functions and variables declarations that
are publicly defined and exported by the binary. So only those
types are present in the output of ``abidw``. This option however
makes ``abidw`` load *all* the types defined in the binaries, even
those that are not reachable from public declarations.
* ``--stats``
Emit statistics about various internal things.
Notes
=====
.. _alt-di-label:
Alternate debug info files
--------------------------
As of the version 4 of the DWARF specification, `Alternate debug
information <http://www.dwarfstd.org/ShowIssue.php?issue=120604.1>`_
is a `GNU`_ extension to the DWARF specification. It has however been
proposed for inclusion into the upcoming version 5 of the DWARF
standard. You can read more about the GNU extensions to the DWARF
standard `here
<https://fedorahosted.org/elfutils/wiki/DwarfExtensions>`_.
.. _ELF: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
.. _DWARF: http://www.dwarfstd.org
.. _GNU: http://www.gnu.org