From: Dodji Seketeli Date: Tue, 21 Jul 2015 13:49:25 +0000 (+0200) Subject: Show linkage names in abipkgdiff output X-Git-Tag: 1.0.rc0~173 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=819f8941cf924126e2cd065f1002412e50a5a46d;p=libabigail.git Show linkage names in abipkgdiff output With this patch abipkgdiff now shows the linkage names of added/removed functions and variables. In addition, there now is a --no-linkage-name option to avoid seeing linkage names. * doc/manuals/abipkgdiff.rst: Document the new --no-linkage-name options. * tools/abipkgdiff.cc (options::show_linkage_names): New data member. (options::options): Initialize it. (display_usage): Display a usage string for --no-linkage-name. (parse_command_line): Parse the --no-linkage-name option. (set_diff_context_from_opts): Set the diff context accordingly. * tests/data/test-diff-pkg/test-rpm-report-0.txt: Adjust. Signed-off-by: Dodji Seketeli --- diff --git a/doc/manuals/abipkgdiff.rst b/doc/manuals/abipkgdiff.rst index f9beeac2..9c4ac567 100644 --- a/doc/manuals/abipkgdiff.rst +++ b/doc/manuals/abipkgdiff.rst @@ -59,6 +59,11 @@ Options change is a change that has been displayed elsewhere in a given report. + * ``--no-linkage-name`` + + In the resulting report, do not display the linkage names of + the added, removed, or changed functions or variables. + * ``--no-added-binaries`` Do not show the list of binaries that got added to the second diff --git a/tests/data/test-diff-pkg/test-rpm-report-0.txt b/tests/data/test-diff-pkg/test-rpm-report-0.txt index bd3ae443..95475ccb 100644 --- a/tests/data/test-diff-pkg/test-rpm-report-0.txt +++ b/tests/data/test-diff-pkg/test-rpm-report-0.txt @@ -6,8 +6,8 @@ 2 Removed functions: - 'function BaseInfo* base_info_ref(BaseInfo*)' - 'function void base_info_unref(BaseInfo*)' + 'function BaseInfo* base_info_ref(BaseInfo*)' {base_info_ref} + 'function void base_info_unref(BaseInfo*)' {base_info_unref} 1 Added function symbol not referenced by debug info: diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 1be3f0ce..9ce426ab 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -95,6 +95,7 @@ struct options string debug_package1; string debug_package2; bool compare_dso_only; + bool show_linkage_names; bool show_redundant_changes; bool show_added_binaries; vector suppression_paths; @@ -103,6 +104,7 @@ struct options : display_usage(), missing_operand(), compare_dso_only(), + show_linkage_names(true), show_redundant_changes(), show_added_binaries(true) {} @@ -242,6 +244,8 @@ display_usage(const string& prog_name, ostream& out) << " --debug-info-pkg2|--d2 path of debug-info package of package2\n" << " --suppressions|--suppr specify supression specification path\n" << " --dso-only pompare shared libraries only\n" + << " --no-linkage-name do not display linkage names of " + "added/removed/changed\n" << " --redundant display redundant changes\n" << " --no-added-binaries do not display added binaries\n" << " --verbose emit verbose progress messages\n" @@ -360,6 +364,7 @@ set_diff_context_from_opts(diff_context_sptr ctxt, ctxt->default_output_stream(&cout); ctxt->error_output_stream(&cerr); ctxt->show_redundant_changes(opts.show_redundant_changes); + ctxt->show_linkage_names(opts.show_linkage_names); ctxt->switch_categories_off (abigail::comparison::ACCESS_CHANGE_CATEGORY @@ -774,6 +779,8 @@ parse_command_line(int argc, char* argv[], options& opts) } else if (!strcmp(argv[i], "--dso-only")) opts.compare_dso_only = true; + else if (!strcmp(argv[i], "--no-linkage-name")) + opts.show_linkage_names = false; else if (!strcmp(argv[i], "--redundant")) opts.show_redundant_changes = true; else if (!strcmp(argv[i], "--no-added-binaries"))