libabigail/tests/data/test-read-write/test15.xml

18 lines
706 B
XML
Raw Normal View History

Bump ABIXML format version to 2.0 After fixing the interpretation of the DW_AT_bit_offset attribute for offset of bit field data members, serialized abixml might now be incompatible with versions of Libabigail that use the previous interpretation. That means that comparing an abixml file generated with previous versions of Libabigail against a corpus resulting from an analysis performed with the current version of libabigail might yield spurious changes due to the differences in the way we now interpret the DW_AT_bit_offset. Hence, this patch bumps the version of abixml files emitted from now on to "2.0". This version is deemed incompatible with the previous "1.0" version. Subsequently, an abixml file of the "1.0" format cannot be compared against an abixml file of the "2.0" format, or against a binary analyzed with a current version of Libabigail. It's thus advised that abixml files of the "1.0" format version should be re-generated with a current version of Libabigail, bumping their format version number to the new "2.0". * include/abg-corpus.h (corpus::init_format_version): Declare new private method. (corpus::set_environment): Make this non-const. (corpus::{get,set}_format_{major,minor}_version_number): Declare new accessors. * src/abg-corpus.cc (corpus::init_format_version): Define new method. (corpus::set_environment): By default, initialize the format version number of the corpus to the one supported by Libabigail. (corpus::{get,set}_format_{major,minor}_version_number): Define new accessors. * include/abg-ir.h: Include abg-config.h to use the abigail::config. (environment::get_config): Declare new accessor. * src/abg-ir.cc (environment::priv::config_): Add new data member. (environment::get_config): Define new accessor. * src/abg-config.cc (config::config): Bump the format version number to "2.0". * src/abg-corpus-priv.h (corpus::priv::format_{major,minor}_version_number_): Add new data members. * src/abg-reader.cc (handle_version_attribute): Define new static function. (read_corpus_from_input, read_corpus_group_from_input): Use it to read the value of the "version" attribute and set the format version number of the corpus and corpus group accordingly. * src/abg-writer.cc (write_context::m_config): Remove the config object because we can now get it from the environment. (write_context::get_config): Get the config object from the environment. (write_translation_unit): Do not emit the version attribute on the translation unit element anymore. (write_version_info): Define static function. (write_corpus, write_corpus_group): Use it to emit version attribute on both the corpus and corpus group elements. * tools/abidiff.cc (emit_incomptatible_format_version_error_message): Define new static function. (main): Ensure that corpora and corpus groups being compared have the same major version number. * tests/update-test-output.py: Adjust syntax for python3. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test2.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test3.so.abi: Likewise. * tests/data/test-annotate/test4.so.abi: Likewise. * tests/data/test-annotate/test5.o.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0.abi: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1-report-0.txt: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Likewise. * tests/data/test-diff-suppr/libtest48-soname-abixml-v0.so.abi: Likewise. * tests/data/test-diff-suppr/libtest48-soname-abixml-v1.so.abi: Likewise. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/PR24378-fn-is-not-scope.abi: Likewise. * tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise. * tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi: Likewise. * tests/data/test-read-dwarf/PR26261/PR26261-exe.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test-PR26568-1.o.abi: Likewise. * tests/data/test-read-dwarf/test-PR26568-2.o.abi: Likewise. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test0.hash.abi: Likewise. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test1.hash.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. * tests/data/test-read-dwarf/test2.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test4.so.abi: Likewise. * tests/data/test-read-dwarf/test4.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test5.o.abi: Likewise. * tests/data/test-read-dwarf/test5.o.hash.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. * tests/data/test-read-dwarf/test6.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test0.xml: Likewise. * tests/data/test-read-write/test1.xml: Likewise. * tests/data/test-read-write/test10.xml: Likewise. * tests/data/test-read-write/test11.xml: Likewise. * tests/data/test-read-write/test12.xml: Likewise. * tests/data/test-read-write/test13.xml: Likewise. * tests/data/test-read-write/test14.xml: Likewise. * tests/data/test-read-write/test15.xml: Likewise. * tests/data/test-read-write/test16.xml: Likewise. * tests/data/test-read-write/test17.xml: Likewise. * tests/data/test-read-write/test18.xml: Likewise. * tests/data/test-read-write/test19.xml: Likewise. * tests/data/test-read-write/test2.xml: Likewise. * tests/data/test-read-write/test20.xml: Likewise. * tests/data/test-read-write/test21.xml: Likewise. * tests/data/test-read-write/test22.xml: Likewise. * tests/data/test-read-write/test23.xml: Likewise. * tests/data/test-read-write/test24.xml: Likewise. * tests/data/test-read-write/test25.xml: Likewise. * tests/data/test-read-write/test26.xml: Likewise. * tests/data/test-read-write/test27.xml: Likewise. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Likewise. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Likewise. * tests/data/test-read-write/test3.xml: Likewise. * tests/data/test-read-write/test4.xml: Likewise. * tests/data/test-read-write/test5.xml: Likewise. * tests/data/test-read-write/test6.xml: Likewise. * tests/data/test-read-write/test7.xml: Likewise. * tests/data/test-read-write/test8.xml: Likewise. * tests/data/test-read-write/test9.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-10-22 14:04:08 +00:00
<abi-instr path='data/test-read-write/test15.xml'>
Initial support of class templates * src/abg-ir.cc (class_template_decl::class_template_decl) (class_template_decl::set_pattern) (class_template_decl::operator==) (class_template_decl::~class_template_decl) (class_template_decl_hash::operator()) (class_tmpl_shared_ptr_hash::operator()): New definitions. * src/abg-ir.h (class class_template_decl, struct class_tmpl_shared_ptr_hash, struct class_tmpl_shared_ptr_hash): New declarations. * src/abg-reader.cc (read_context::const_class_tmpl_map_it): New typedef. (read_context::get_fn_tmpl_decl): Fix comment. (read_context::{get_class_tmpl_decl,key_class_tmpl_decl}) (build_class_template_decl, handle_class_template_decl): New definitions. (read_context::m_class_tmpl_map): New member. (handle_element): Support "class-template-decl" xml elements nodes. (build_class_decl): Add missing bits to comment. (build_function_template_decl): Fix spacing. * src/abg-writer.cc (class_tmpl_shared_ptr_map): New typedef. (write_context::m_class_tmpl_map): New member. (write_context::get_id_for_class_tmpl, write_class_template_decl): New definitions. (write_template_parameters): Factorize this this out from ... (write_function_template_decl): ... here. (write_decl): Support writing instances of class_template_decl. Fix spacing. * tests/data/test-read-write/test15.xml: New test input. * tests/Makefile.am: Add the new test15.xml input to the distribution. * tests/test-read-write.cc (in_out_specs): Add the new test15.xml test to the list of serialized output to be de-serialized and serialized back.
2013-05-02 13:25:04 +00:00
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
<class-template-decl id='class-tmpl-id-2'>
<template-type-parameter id='type-id-3' name='T'/>
<class-decl name='C' visibility='default' id='type-id-4'>
abg-writer.cc: Fix indentation of XML output The XML writer produces valid XML. However, it differs in a few respects from that obtained with xmllint --format. - there is no XML declaration at the start - attributes use single quotes rather than double quotes - indentation is mostly 2 spaces but this is broken in places This commit fixes the last of these issues as it actually causes readability issues when examining diffs. It also does this for every test XML file, whether used as input, compared against output or not used at all, to match what xmllint --format would do. * src/abg-writer.cc (write_canonical_types_of_scope): Do not add additional indentation. (write_translation_unit): Pass additional indentation to write_canonical_types_of_scope. (write_class_decl): Ensure optional annotations of base classes have the same indentation as the base classes themselves. * tests/data/test-annotate/libtest23.so.abi: Fix indentation. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Ditto. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Ditto. * tests/data/test-annotate/test-anonymous-members-0.o.abi: Ditto. * tests/data/test-annotate/test1.abi: Ditto. * tests/data/test-annotate/test14-pr18893.so.abi: Ditto. * tests/data/test-annotate/test15-pr18892.so.abi: Ditto. * tests/data/test-annotate/test17-pr19027.so.abi: Ditto. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Ditto. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Ditto. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Ditto. * tests/data/test-annotate/test21-pr19092.so.abi: Ditto. * tests/data/test-diff-suppr/test45-abi-wl.xml: Ditto. * tests/data/test-diff-suppr/test45-abi.xml: Ditto. * tests/data/test-diff-suppr/test46-PR25128-base.xml: Ditto. * tests/data/test-diff-suppr/test46-PR25128-new.xml: Ditto. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Ditto. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Ditto. * tests/data/test-read-dwarf/libtest23.so.abi: Ditto. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Ditto. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Ditto. * tests/data/test-read-dwarf/test1.abi: Ditto. * tests/data/test-read-dwarf/test1.hash.abi: Ditto. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Ditto. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Ditto. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Ditto. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Ditto. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Ditto. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Ditto. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Ditto. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Ditto. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Ditto. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Ditto. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Ditto. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Ditto. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Ditto. * tests/data/test-read-write/test10.xml: Ditto. * tests/data/test-read-write/test15.xml: Ditto. * tests/data/test-read-write/test21.xml: Ditto. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Ditto. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Ditto. Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-07-16 15:35:27 +00:00
<member-type access='public'>
<typedef-decl name='TINT' type-id='type-id-1' id='type-id-5'/>
</member-type>
Initial support of class templates * src/abg-ir.cc (class_template_decl::class_template_decl) (class_template_decl::set_pattern) (class_template_decl::operator==) (class_template_decl::~class_template_decl) (class_template_decl_hash::operator()) (class_tmpl_shared_ptr_hash::operator()): New definitions. * src/abg-ir.h (class class_template_decl, struct class_tmpl_shared_ptr_hash, struct class_tmpl_shared_ptr_hash): New declarations. * src/abg-reader.cc (read_context::const_class_tmpl_map_it): New typedef. (read_context::get_fn_tmpl_decl): Fix comment. (read_context::{get_class_tmpl_decl,key_class_tmpl_decl}) (build_class_template_decl, handle_class_template_decl): New definitions. (read_context::m_class_tmpl_map): New member. (handle_element): Support "class-template-decl" xml elements nodes. (build_class_decl): Add missing bits to comment. (build_function_template_decl): Fix spacing. * src/abg-writer.cc (class_tmpl_shared_ptr_map): New typedef. (write_context::m_class_tmpl_map): New member. (write_context::get_id_for_class_tmpl, write_class_template_decl): New definitions. (write_template_parameters): Factorize this this out from ... (write_function_template_decl): ... here. (write_decl): Support writing instances of class_template_decl. Fix spacing. * tests/data/test-read-write/test15.xml: New test input. * tests/Makefile.am: Add the new test15.xml input to the distribution. * tests/test-read-write.cc (in_out_specs): Add the new test15.xml test to the list of serialized output to be de-serialized and serialized back.
2013-05-02 13:25:04 +00:00
<data-member access='private'>
<var-decl name='m_first' type-id='type-id-3'/>
</data-member>
<data-member access='private'>
<var-decl name='m_second' type-id='type-id-5'/>
</data-member>
</class-decl>
</class-template-decl>
</abi-instr>