Represent sizes and offsets in bytes and hexadecimal values
In current change reports, sizes and offsets are represented in bits,
and as decimal values. Some users prefer having those offsets be in
bytes and as hexadecimal values.
This commits adds 4 new options to let users see sizes and offsets be
represented either in bits, bytes, decimal or hexadecimal values.
* doc/manuals/abidiff.rst: Add documentation for the new
--show-bits, --show-bytes, --show-hex and --show-dec options.
* doc/manuals/abipkgdiff.rst: Likewise.
* doc/manuals/kmidiff.rst: Likewise.
* include/abg-comparison.h (diff_context::{show_hex_values,
show_offsets_sizes_in_bits}): Declare new member functions.
* src/abg-comparison-priv.h (diff_context::priv::{hex_values_,
show_offsets_sizes_in_bits_}): Declare new data members.
(diff_context::priv::priv): Initialize them.
* src/abg-comparison.cc (diff_context::{show_hex_values,
show_offsets_sizes_in_bits}): Define new member functions.
* src/abg-default-reporter.cc (default_reporter::report): Adjust
the call to maybe_report_diff_for_symbol.
* src/abg-leaf-reporter.cc (leaf_reporter::report): Likewise.
* src/abg-reporter-priv.h (convert_bits_to_bytes)
(maybe_convert_bits_to_bytes, emit_num_value, show_offset_or_size)
(show_numerical_change): Declare new functions.
(maybe_report_diff_for_symbol): Take a diff_context in parameter.
* src/abg-reporter-priv.cc (convert_bits_to_bytes, emit_num_value)
(maybe_convert_bits_to_bytes, show_numerical_change)
(show_offset_or_size): Define new functions.
(represent): In the overload for method_decl, var_decl, use the
new emit_num_value function.
(represent_data_member): Use the new show_offset_or_size function.
(maybe_show_relative_offset_change): Use the new
convert_bits_to_bytes, diff_context::show_offsets_sizes_in_bits,
emit_num_value functions.
(maybe_show_relative_offset_change): Likewise.
(report_size_and_alignment_changes): Use the new emit_num_value
and show_numerical_change functions.
(maybe_report_diff_for_symbol): Tak a diff_context in argument.
Use the new show_numerical_change function.
* tests/test-diff-filter.cc (in_out_spec): Add a new entry to test
hexa and bytes output.
* tools/abidiff.cc (options::{show_hexadecimal_values,
show_offsets_sizes_in_bits}): New data members.
(options::options): Initialize them.
(display_usage): New help strings for the new
--show{bytes,bits,hex,dec} options.
(parse_command_line): Parse the new --show{bytes,bits,hex,dec} options.
(set_diff_context_from_opts) Set the diff context wrt hex and
bytes values.
* tools/abipkgdiff.cc (options::{show_hexadecimal_values,
show_offsets_sizes_in_bits}): New data members.
(options::options): Initialize them.
(display_usage): New help strings for the new
--show{bytes,bits,hex,dec} options.
(set_diff_context_from_opts): Set the diff context wrt hex and
bytes values.
(parse_command_line): Parse the new --show{bytes,bits,hex,dec}
options.
* tools/kmidiff.cc (options::{show_hexadecimal_values,
show_offsets_sizes_in_bits}): New data members.
(options::options): Initialize them.
(display_usage):New help strings for the new
--show{bytes,bits,hex,dec} options.
(parse_command_line): Parse the new --show{bytes,bits,hex,dec}
options.
(set_diff_context): Set the diff context wrt hex and bytes values.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt:
New reference test output.
* tests/data/Makefile.am: Add the new reference test output above
to source distribution.
* tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: Likewise.
* tests/data/test-abicompat/test5-fn-changed-report-0.txt: Likewise.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-0.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-0.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-abicompat/test8-fn-changed-report-0.txt: Likewise.
* tests/data/test-abicompat/test9-fn-changed-report-0.txt: Likewise.
* tests/data/test-abidiff/test-PR18791-report0.txt: Likewise.
* tests/data/test-abidiff/test-qual-type0-report.txt: Likewise.
* tests/data/test-abidiff/test-struct0-report.txt: Likewise.
* tests/data/test-abidiff/test-struct1-report.txt: Likewise.
* tests/data/test-abidiff/test-var0-report.txt: Likewise.
* tests/data/test-diff-dwarf/test0-report.txt: Likewise.
* tests/data/test-diff-dwarf/test1-report.txt: Likewise.
* tests/data/test-diff-dwarf/test10-report.txt: Likewise.
* tests/data/test-diff-dwarf/test11-report.txt: Likewise.
* tests/data/test-diff-dwarf/test13-report.txt: Likewise.
* tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: Likewise.
* tests/data/test-diff-dwarf/test27-local-base-diff-report.txt: Likewise.
* tests/data/test-diff-dwarf/test3-report.txt: Likewise.
* tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test34-pr19173-libfoo-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test37-union-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test39-union-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test40-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise.
* tests/data/test-diff-dwarf/test8-report.txt: Likewise.
* tests/data/test-diff-dwarf/test9-report.txt: Likewise.
* tests/data/test-diff-filter/test0-report.txt: Likewise.
* tests/data/test-diff-filter/test01-report.txt: Likewise.
* tests/data/test-diff-filter/test1-report.txt: Likewise.
* tests/data/test-diff-filter/test10-report.txt: Likewise.
* tests/data/test-diff-filter/test11-report.txt: Likewise.
* tests/data/test-diff-filter/test13-report.txt: Likewise.
* tests/data/test-diff-filter/test14-0-report.txt: Likewise.
* tests/data/test-diff-filter/test14-1-report.txt: Likewise.
* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
* tests/data/test-diff-filter/test15-1-report.txt: Likewise.
* tests/data/test-diff-filter/test16-report-2.txt: Likewise.
* tests/data/test-diff-filter/test16-report.txt: Likewise.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
* tests/data/test-diff-filter/test17-1-report.txt: Likewise.
* tests/data/test-diff-filter/test2-report.txt: Likewise.
* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise.
* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt: Likewise.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt: Likewise.
* tests/data/test-diff-filter/test3-report.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise.
* tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: Likewise.
* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.
* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise.
* tests/data/test-diff-filter/test37-report-0.txt: Likewise.
* tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise.
* tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Likewise.
* tests/data/test-diff-filter/test6-report.txt: Likewise.
* tests/data/test-diff-filter/test9-report.txt: Likewise.
* tests/data/test-diff-pkg/dirpkg-1-report-1.txt: Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-1.txt: Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise.
* tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Likewise.
* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.
* tests/data/test-diff-pkg/symlink-dir-test1-report0.txt: Likewise.
* tests/data/test-diff-pkg/tarpkg-0-report-0.txt: Likewise.
* tests/data/test-diff-pkg/tarpkg-1-report-0.txt: Likewise.
* tests/data/test-diff-pkg/tbb-4.1-9.
20130314.fc22.x86_64--tbb-4.3-3.
20141204.fc23.x86_64-report-0.txt: Likewise.
* tests/data/test-diff-pkg/tbb-4.1-9.
20130314.fc22.x86_64--tbb-4.3-3.
20141204.fc23.x86_64-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test11-add-data-member-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test12-add-data-member-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test12-add-data-member-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test15-suppr-added-fn-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test15-suppr-added-fn-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test17-suppr-added-var-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test17-suppr-added-var-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test18-suppr-removed-var-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test18-suppr-removed-var-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test18-suppr-removed-var-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test23-alias-filter-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test23-alias-filter-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-10.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise.
* tests/data/test-diff-suppr/test24-soname-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test25-typedef-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test26-loc-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test26-loc-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test29-soname-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test29-soname-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test29-soname-report-8.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test30-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test31-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test32-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test32-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test33-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise.
* tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>