From 8c51a895250f787c31a8027a66b363d95c3a9beb Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 2 Nov 2017 12:46:32 +0100 Subject: [PATCH] Wire the --no-show-locs option to abidw Up until now, the --no-show-locs option only had effect when abidiff was used with the --abidiff option. It had no effect on the ABIXML output of abidw. This patch changes that to make it so that --no-show-locs avoids emitting source location to the ABIXML output. * doc/manuals/abidw.rst: Update the documentation. * tests/test-annotate.cc: Now that --no-show-locs has an effect on the ABIXML output, let's not use it here, because it changes the output and we don't want that. * tools/abidw.cc (display_usage): Fix a typo in the help string. (load_corpus_and_write_abixml): Set the "show-locs" option to the write_context object that we use. Signed-off-by: Dodji Seketeli --- doc/manuals/abidw.rst | 4 ++-- tests/test-annotate.cc | 2 +- tools/abidw.cc | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/manuals/abidw.rst b/doc/manuals/abidw.rst index e2a76850..1645134b 100644 --- a/doc/manuals/abidw.rst +++ b/doc/manuals/abidw.rst @@ -146,8 +146,8 @@ Options * ``--no-show-locs`` - Do not show information about where in the *second shared library* - the respective type was changed. + In the emitted ABI representation, do not show file, line or column + where ABI artifacts are defined. * ``--check-alternate-debug-info-base-name`` <*elf-path*> diff --git a/tests/test-annotate.cc b/tests/test-annotate.cc index 565401d6..c8b97041 100644 --- a/tests/test-annotate.cc +++ b/tests/test-annotate.cc @@ -155,7 +155,7 @@ main() string abidw; abidw = string(get_build_dir()) + "/tools/abidw " - "--annotate --no-show-locs --no-corpus-path"; + "--annotate --no-corpus-path"; for (InOutSpec* s = in_out_specs; s->in_elf_path; ++s) { in_elf_path = string(get_src_dir()) + "/tests/" + s->in_elf_path; diff --git a/tools/abidw.cc b/tools/abidw.cc index 1ecda80e..87cd269c 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -136,7 +136,7 @@ display_usage(const string& prog_name, ostream& out) << " --suppressions|--suppr specify a suppression file\n" << " --no-architecture do not emit architecture info in the output\n" << " --no-corpus-path do not take the path to the corpora into account\n" - << " --no-show-locs do now show location information\n" + << " --no-show-locs do not show location information\n" << " --check-alternate-debug-info check alternate debug info " "of \n" << " --check-alternate-debug-info-base-name check alternate " @@ -474,6 +474,7 @@ load_corpus_and_write_abixml(char* argv[], abigail::xml_writer::write_context_sptr write_ctxt = abigail::xml_writer::create_write_context(corp->get_environment(), of); + abigail::xml_writer::set_show_locs(*write_ctxt, opts.show_locs); abigail::xml_writer::set_annotate(*write_ctxt, opts.annotate); abigail::xml_writer::write_corpus(corp, 0, *write_ctxt); of.close(); @@ -484,6 +485,7 @@ load_corpus_and_write_abixml(char* argv[], abigail::xml_writer::write_context_sptr write_ctxt = abigail::xml_writer::create_write_context(corp->get_environment(), cout); + abigail::xml_writer::set_show_locs(*write_ctxt, opts.show_locs); abigail::xml_writer::set_annotate(*write_ctxt, opts.annotate); exit_code = !abigail::xml_writer::write_corpus(corp, 0, *write_ctxt); } -- 2.34.1