Add a new --noout option to abidw

* tools/abidw.cc (options::noout): New data member.
	(options::options): Initialize it.
	(display_usage): Add a usage string for the new option.
	(parse_command_line): Parse the new option.
	(main): If --noout is provided, do not emit the XML form.
 	* doc/manuals/abidw.rst: Document the new option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-08-29 13:07:47 +02:00
parent e61afa7291
commit 277e524392
2 changed files with 16 additions and 1 deletions

View File

@ -45,6 +45,13 @@ Options
*path-to-elf-file* into the file *file-path*, rather than emitting
it to its standard output.
* ``--noout``
This option instructs ``abidw`` to not emit the XML representation
of the ABI. So it only reads the ELF and debug information,
builds the internal representation of the ABI and exits. This
option is usually useful for debugging purposes.
* ``--check-alternate-debug-info`` <*elf-path*>
If the debug info for the file *elf-path* contains a reference to

View File

@ -57,13 +57,15 @@ struct options
bool write_architecture;
bool load_all_types;
bool show_stats;
bool noout;
options()
: check_alt_debug_info_path(),
show_base_name_alt_debug_info_path(),
write_architecture(true),
load_all_types(),
show_stats()
show_stats(),
noout()
{}
};
@ -75,6 +77,7 @@ display_usage(const string& prog_name, ostream& out)
<< " --help|-h display this message\n"
<< " --debug-info-dir|-d <dir-path> look for debug info under 'dir-path'\n"
<< " --out-file <file-path> write the output to 'file-path'\n"
<< " --noout do not emit anything after reading the binary\n"
<< " --no-architecture do not emit architecture info in the output\n"
<< " --check-alternate-debug-info <elf-path> check alternate debug info "
"of <elf-path>\n"
@ -124,6 +127,8 @@ parse_command_line(int argc, char* argv[], options& opts)
opts.out_file_path = argv[i + 1];
++i;
}
else if (!strcmp(argv[i], "--noout"))
opts.noout = true;
else if (!strcmp(argv[i], "--no-architecture"))
opts.write_architecture = false;
else if (!strcmp(argv[i], "--check-alternate-debug-info")
@ -254,6 +259,9 @@ main(int argc, char* argv[])
}
else
{
if (opts.noout)
return 0;
if (!opts.write_architecture)
corp->set_architecture_name("");