From patchwork Tue May 25 10:24:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 43565 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 728BB3848009; Tue, 25 May 2021 10:24:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 728BB3848009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621938278; bh=RJrKRA8MV7J0xPCKEp+U8F6NCTuAEjj9E1OXpdYov7Q=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=cAjTvXWJ5EYphj2i41iMyyf0Cgr/1M3hONQKnkcw26Nxohcj3ed/wrG69dkXhGbnz czSQqL09tIpFGMaMsA2boMuGzbryCew9Jeq0OnJCcKwE+fhh/BCR/sqiTKwLp3/Fs8 i20Uwo94luVGJgcJfLvgmU/A7Sj+x/FJcr0XaHqQ= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 887B83848009 for ; Tue, 25 May 2021 10:24:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 887B83848009 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-8A1JBjSfPDSzFsuIwjAYaQ-1; Tue, 25 May 2021 06:24:19 -0400 X-MC-Unique: 8A1JBjSfPDSzFsuIwjAYaQ-1 Received: by mail-wr1-f72.google.com with SMTP id u20-20020a0560001614b02901115c8f2d89so14237568wrb.3 for ; Tue, 25 May 2021 03:24:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=RJrKRA8MV7J0xPCKEp+U8F6NCTuAEjj9E1OXpdYov7Q=; b=egLa6PFZHujUYetCjSXxBk2q6HfE5q2S37Uj/shTgvZJcbj+XvcDx7PBInXsbK626k nTLtDu0J3iYBayboUmIea5dZE/Cta7sKvv65K7rZLDckEc+qUVFZIEeHi+Ee7vktQA38 Y9+QeMZ9kadCGI48gC57rfhnF+StdkQ7Z/nIjSX32LALDvufc8aAtIDgtuU5xyy92UKk 1ULJA5vFFn54eWOf8x/3KdUNFSE086mUTkHxGSsvXDbz6LOpo4NO+6N1sU2cFi9+uDwX ttI9gr0MWfOycsSGMGPuOiVqm0KI9PvzfkXjp7OVDgRx8S4NCihKsUfIGhP5MvsqN+uU 2RpQ== X-Gm-Message-State: AOAM533Jf7s6d18afyydEY/Z1oSkWa+t7Y7vsyXPqfrAvFDWC4PZ4ngV 1FdhvazQouvsXd8SZttD3foI+/GcKTWhD8N0gBDLgqFjYuqy/3k61osweT/S4XBiHTgE+9+08pm g2oro6AWxsTUqirTODb23enelvYdMWRBHTfXdiqXvm3YB2M4d5g0TgsumkyHRVNaf8Ogj X-Received: by 2002:a1c:df04:: with SMTP id w4mr23094367wmg.158.1621938258054; Tue, 25 May 2021 03:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6RASYYaBZAnD1OjDg+n6aw8YGpcx4uOw/Kg8d0OoSGeuEGsNhiE/thtMsG5iZuG5m7srtMg== X-Received: by 2002:a1c:df04:: with SMTP id w4mr23094345wmg.158.1621938257715; Tue, 25 May 2021 03:24:17 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id c4sm15922515wrx.77.2021.05.25.03.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:24:17 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 7315658000E; Tue, 25 May 2021 12:24:16 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH, applied] Detect failed self comparison in type canonicalization of abixml Organization: Red Hat / France X-Operating-System: Fedora 35 X-URL: http://www.redhat.com Date: Tue, 25 May 2021 12:24:16 +0200 Message-ID: <87v9773ycv.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, During the self comparison triggered by "abidw --abidiff ", some comparison errors can happen when canonicalizing types that are "de-serialized" from the abixml that was serialized from the input binary. This patch adds some debugging checks and messaging to emit a message when a type from the abixml appears to not "match" the original type from the initial corpus it originated from. This is the more detailed description: Let's consider a type T coming from the corpus of the input binary. That input corpus is serialized into abixml and de-serialized again into a second corpus that we shall name the abixml corpus. From that second corpus, let's consider the type T' that is the result of serializing T into abixml and de-serializing it again. T is said to be the original type of T'. If T is a canonical type, then T' should equal T. Otherwise, if T is not a canonical type, its canonical type should equal the canonical type of T'. For the sake of simplicity, let's consider that T is a canonical type. During the canonicalization of T', T' should equal T. Each and every canonical type coming from the abixml corpus should be equal to its original type from the binary corpus. If a T' is different from its original type T, then there is an "equality problem" between T and T'. In other words, there is a mismatch between T and T'. We want to be notified of that problem so that we can debug it further and fix it. So this patch introduces the option "abidw --debug-abidiff " to trigger the "debug self comparison mode". At canonicalization time, we detect that we are in that debug self comparison mode and during canonicalization of types from the abixml corpus, it detects when they compare different from their counterpart from the original corpus. This debugging capability can be enabled at configure time with a new --enable-debug-self-comparison configure option. That option defines a new WITH_DEBUG_SELF_COMPARISON compile time macro that is used to conditionally compile the implementation of this debugging feature. So, one example of this might look like this: abidw --debug-abidiff bin: error: problem detected with type 'typedef Vmalloc_t' from second corpus error: problem detected with type 'Vmalloc_t*' from second corpus [...] So that means the "typedef Vmalloc_t" read from the abixml compares different from its original type where it should not. So armed with this new insight, I know I need to debug that comparison in particular to see why it wrongly results in two different types. * doc/manuals/abidw.rst: Add documentation for the --debug-abidiff option. * include/abg-ir.h (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Declare new methods. * configure.ac: Define a new --enable-debug-self-comparison option that is disabled by default. That option defines a new WITH_DEBUG_SELF_COMPARISON preprocessor macro. * src/abg-ir.cc (environment::priv::{first_self_comparison_corpus_, second_self_comparison_corpus_, self_comparison_debug_on_}): New data members. Also, re-indent the data members. (environment::{set_self_comparison_debug_input, get_self_comparison_debug_inputs, self_comparison_debug_is_on}): Define new method. (type_base::get_canonical_type_for): In the "debug self comparison mode", if a type coming from the second corpus compares different from its counterpart coming from the first corpus then log a debug message. * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): When loading the first corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * src/abg-reader.cc (read_corpus_from_input): When loading the second corpus, if the debug self comparison mode is on, then save that corpus on the side in the environment. * tools/abidw.cc: Include the config.h file for preprocessor macros defined at configure (options::debug_abidiff): New data member. (parse_command_line): Parse the --debug-abidiff option. (load_corpus_and_write_abixml): Switch the self debug mode on when the --debug-abidiff option is provided. Use a read_context for the abixml loading. That is going to be useful for subsequent patches. Signed-off-by: Dodji Seketeli Applied to master. --- configure.ac | 17 ++++++ doc/manuals/abidw.rst | 10 ++++ include/abg-ir.h | 15 +++++ src/abg-dwarf-reader.cc | 10 ++++ src/abg-ir.cc | 122 ++++++++++++++++++++++++++++++++++++++-- src/abg-reader.cc | 18 ++++++ tools/abidw.cc | 32 ++++++++++- 7 files changed, 216 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 0b64c3e5..735cc9de 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,12 @@ AC_ARG_ENABLE(rpm415, ENABLE_RPM415=$enableval, ENABLE_RPM415=auto) +AC_ARG_ENABLE(debug-self-comparison, + AS_HELP_STRING([--enable-debug-self-comparison=yes|no], + [enable debugging of self comparison with 'abidw --debug-abidiff'(default is no)]), + ENABLE_DEBUG_SELF_COMPARISON=$enableval, + ENABLE_DEBUG_SELF_COMPARISON=no) + AC_ARG_ENABLE(deb, AS_HELP_STRING([--enable-deb=yes|no|auto], [enable the support of deb in abipkgdiff (default is auto)]), @@ -297,6 +303,16 @@ fi AM_CONDITIONAL(ENABLE_RPM, test x$ENABLE_RPM = xyes) +dnl enable the debugging of self comparison when doing abidw --debug-abidiff +if test x$ENABLE_DEBUG_SELF_COMPARISON = xyes; then + AC_DEFINE([WITH_DEBUG_SELF_COMPARISON], 1, [compile support of debugging abidw --abidiff]) + AC_MSG_NOTICE([support of debugging self comparison is enabled]) +else + AC_MSG_NOTICE([support of debugging self comparison is disabled]) +fi + +AM_CONDITIONAL(ENABLE_DEBUG_SELF_COMPARISON, test x$ENABLE_DEBUG_SELF_COMPARISON = xyes) + dnl Check for the dpkg program if test x$ENABLE_DEB = xauto -o x$ENABLE_DEB = xyes; then AC_CHECK_PROG(HAS_DPKG, dpkg, yes, no) @@ -914,6 +930,7 @@ AC_MSG_NOTICE([ libdw has the dwarf_getalt function : ${FOUND_DWARF_GETALT_IN_LIBDW} Enable rpm support in abipkgdiff : ${ENABLE_RPM} Enable rpm 4.15 support in abipkgdiff tests : ${ENABLE_RPM415} + Enable self comparison debugging : ${ENABLE_DEBUG_SELF_COMPARISON} Enable deb support in abipkgdiff : ${ENABLE_DEB} Enable GNU tar archive support in abipkgdiff : ${ENABLE_TAR} Enable bash completion : ${ENABLE_BASH_COMPLETION} diff --git a/doc/manuals/abidw.rst b/doc/manuals/abidw.rst index a67e5fa2..4b110d6b 100644 --- a/doc/manuals/abidw.rst +++ b/doc/manuals/abidw.rst @@ -241,6 +241,16 @@ Options This is a debugging and sanity check option. + * ``--debug-abidiff`` + + Same as ``--abidiff`` but in debug mode. In this mode, error + messages are emitted for types which fail type canonicalization. + + This is an optional debugging and sanity check option. To enable + it the libabigail package needs to be configured with + the --enable-debug-self-comparison option. + + * ``--annotate`` Annotate the ABIXML output with comments above most elements. The diff --git a/include/abg-ir.h b/include/abg-ir.h index 2fbc12e9..d284995f 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -200,6 +200,21 @@ public: const config& get_config() const; +#ifdef WITH_DEBUG_SELF_COMPARISON + void + set_self_comparison_debug_input(const corpus_sptr& corpus); + + void + get_self_comparison_debug_inputs(corpus_sptr& first_corpus, + corpus_sptr& second_corpus); + + void + self_comparison_debug_is_on(bool); + + bool + self_comparison_debug_is_on() const; +#endif + vector* get_canonical_types(const char* name); type_base* get_canonical_type(const char* name, unsigned index); diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 735a4b48..a06ca88f 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -14279,6 +14279,11 @@ read_debug_info_into_corpus(read_context& ctxt) ctxt.exported_decls_builder (ctxt.current_corpus()->get_exported_decls_builder().get()); +#ifdef WITH_DEBUG_SELF_COMPARISON + if (ctxt.env()->self_comparison_debug_is_on()) + ctxt.env()->set_self_comparison_debug_input(ctxt.current_corpus()); +#endif + // Walk all the DIEs of the debug info to build a DIE -> parent map // useful for get_die_parent() to work. { @@ -14451,6 +14456,11 @@ read_debug_info_into_corpus(read_context& ctxt) } } +#ifdef WITH_DEBUG_SELF_COMPARISON + if (ctxt.env()->self_comparison_debug_is_on()) + ctxt.env()->set_self_comparison_debug_input(ctxt.current_corpus()); +#endif + return ctxt.current_corpus(); } diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 31abcc2e..6af7fb78 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -2783,16 +2783,36 @@ struct environment::priv type_base_sptr variadic_marker_type_; unordered_set classes_being_compared_; unordered_set fn_types_being_compared_; - vector extra_live_types_; - interned_string_pool string_pool_; - bool canonicalization_is_done_; - bool do_on_the_fly_canonicalization_; - bool decl_only_class_equals_definition_; + vector extra_live_types_; + interned_string_pool string_pool_; +#ifdef WITH_DEBUG_SELF_COMPARISON + // This is used for debugging purposes. + // When abidw is used with the option --debug-abidiff, some + // libabigail internals need to get a hold on the initial binary + // input of abidw, as well as as the abixml file that represents the + // ABI of that binary. + // + // So this one is the corpus for the input binary. + corpus_wptr first_self_comparison_corpus_; + // This one is the corpus for the ABIXML file representing the + // serialization of the input binary. + corpus_wptr second_self_comparison_corpus_; +#endif + bool canonicalization_is_done_; + bool do_on_the_fly_canonicalization_; + bool decl_only_class_equals_definition_; +#ifdef WITH_DEBUG_SELF_COMPARISON + bool self_comparison_debug_on_; +#endif priv() : canonicalization_is_done_(), do_on_the_fly_canonicalization_(true), decl_only_class_equals_definition_(false) +#ifdef WITH_DEBUG_SELF_COMPARISON + , + self_comparison_debug_on_(false) +#endif {} };// end struct environment::priv @@ -3186,6 +3206,61 @@ const config& environment::get_config() const {return priv_->config_;} +#ifdef WITH_DEBUG_SELF_COMPARISON +/// Setter of the corpus of the input corpus of the self comparison +/// that takes place when doing "abidw --debug-abidiff ". +/// +/// The first invocation of this function sets the first corpus of the +/// self comparison. The second invocation of this very same function +/// sets the second corpus of the self comparison. That second corpus +/// is supposed to come from the abixml serialization of the first +/// corpus. +/// +/// @param c the corpus of the input binary or the corpus of the +/// abixml serialization of the initial binary input. +void +environment::set_self_comparison_debug_input(const corpus_sptr& c) +{ + self_comparison_debug_is_on(true); + if (priv_->first_self_comparison_corpus_.expired()) + priv_->first_self_comparison_corpus_ = c; + else if (priv_->second_self_comparison_corpus_.expired() + && c.get() != corpus_sptr(priv_->first_self_comparison_corpus_).get()) + priv_->second_self_comparison_corpus_ = c; +} + +/// Getter for the corpora of the input binary and the intermediate +/// abixml of the self comparison that takes place when doing +/// 'abidw --debug-abidiff '. +/// +/// @param first_corpus output parameter that is set to the corpus of +/// the input corpus. +/// +/// @param second_corpus output parameter that is set to the corpus of +/// the second corpus. +void +environment::get_self_comparison_debug_inputs(corpus_sptr& first_corpus, + corpus_sptr& second_corpus) +{ + first_corpus = priv_->first_self_comparison_corpus_.lock(); + second_corpus = priv_->second_self_comparison_corpus_.lock(); +} + +/// Turn on/off the self comparison debug mode. +/// +/// @param f true iff the self comparison debug mode is turned on. +void +environment::self_comparison_debug_is_on(bool f) +{priv_->self_comparison_debug_on_ = f;} + +/// Test if the we are in the process of the 'self-comparison +/// debugging' as triggered by 'abidw --debug-abidiff' command. +/// +/// @return true if self comparison debug is on. +bool +environment::self_comparison_debug_is_on() const +{return priv_->self_comparison_debug_on_;} +#endif /// Get the vector of canonical types which have a given "string /// representation". @@ -12911,6 +12986,43 @@ type_base::get_canonical_type_for(type_base_sptr t) } if (!result) { +#ifdef WITH_DEBUG_SELF_COMPARISON + if (env->self_comparison_debug_is_on()) + { + // So we are debugging the canonicalization process, + // possibly via the use of 'abidw --debug-abidiff '. + // + // If 't' comes from the second corpus, then it *must* + // be equal to its matching canonical type coming from + // the first corpus because the second corpus is the + // abixml representation of the first corpus. In other + // words, all types coming from the second corpus must + // have canonical types coming from the first corpus. + // + // We are in the case where 't' is different from all + // the canonical types of the same name that come from + // the first corpus. + // + // If 't' indeed comes from the second corpus then this + // clearly is a canonicalization failure. + // + // There was a problem either during the serialization + // of 't' into abixml, or during the de-serialization + // from abixml into abigail::ir. Further debugging is + // needed to determine what that root cause problem is. + // + // Note that the first canonicalization problem of this + // kind must be fixed before looking at the subsequent + // ones, because the later might well just be + // consequences of the former. + corpus_sptr corp1, corp2; + env->get_self_comparison_debug_inputs(corp1, corp2); + if (corp1 && corp2 && (t->get_corpus() == corp2.get())) + std::cerr << "error: problem detected with type '" + << repr + << "' from second corpus\n" << std::flush; + } +#endif v.push_back(t); result = t; } diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 05f1a6fa..9e7db810 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -1835,6 +1835,11 @@ read_corpus_from_input(read_context& ctxt) { corpus_sptr c(new corpus(ctxt.get_environment(), "")); ctxt.set_corpus(c); +#ifdef WITH_DEBUG_SELF_COMPARISON + if (ctxt.get_environment()->self_comparison_debug_is_on()) + ctxt.get_environment()-> + set_self_comparison_debug_input(ctxt.get_corpus()); +#endif } if (!ctxt.get_corpus_group()) @@ -1893,6 +1898,11 @@ read_corpus_from_input(read_context& ctxt) { corpus_sptr c(new corpus(ctxt.get_environment(), "")); ctxt.set_corpus(c); +#ifdef WITH_DEBUG_SELF_COMPARISON + if (ctxt.get_environment()->self_comparison_debug_is_on()) + ctxt.get_environment()-> + set_self_comparison_debug_input(ctxt.get_corpus()); +#endif } if (!ctxt.get_corpus_group()) @@ -5822,6 +5832,10 @@ create_native_xml_read_context(const string& path, environment *env) env)); corpus_sptr corp(new corpus(env)); result->set_corpus(corp); +#ifdef WITH_DEBUG_SELF_COMPARISON + if (env->self_comparison_debug_is_on()) + env->set_self_comparison_debug_input(result->get_corpus()); +#endif result->set_path(path); return result; } @@ -5841,6 +5855,10 @@ create_native_xml_read_context(std::istream* in, environment* env) env)); corpus_sptr corp(new corpus(env, "")); result->set_corpus(corp); +#ifdef WITH_DEBUG_SELF_COMPARISON + if (env->self_comparison_debug_is_on()) + env->set_self_comparison_debug_input(result->get_corpus()); +#endif return result; } diff --git a/tools/abidw.cc b/tools/abidw.cc index 22f640b4..c6f54475 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -11,6 +11,7 @@ /// DWARF format) and emit it back in a set of "text sections" in native /// libabigail XML format. +#include "config.h" #include #include #include @@ -62,6 +63,7 @@ using abigail::xml_writer::type_id_style_kind; using abigail::xml_writer::write_context_sptr; using abigail::xml_writer::write_corpus; using abigail::xml_reader::read_corpus_from_native_xml_file; +using abigail::xml_reader::create_native_xml_read_context; using abigail::dwarf_reader::read_context; using abigail::dwarf_reader::read_context_sptr; using abigail::dwarf_reader::read_corpus_from_elf; @@ -98,6 +100,9 @@ struct options bool noout; bool show_locs; bool abidiff; +#ifdef WITH_DEBUG_SELF_COMPARISON + bool debug_abidiff; +#endif bool annotate; bool do_log; bool drop_private_types; @@ -122,6 +127,9 @@ struct options noout(), show_locs(true), abidiff(), +#ifdef WITH_DEBUG_SELF_COMPARISON + debug_abidiff(), +#endif annotate(), do_log(), drop_private_types(false), @@ -182,6 +190,9 @@ display_usage(const string& prog_name, ostream& out) << " --vmlinux the path to the vmlinux binary to consider to emit " "the ABI of the union of vmlinux and its modules\n" << " --abidiff compare the loaded ABI against itself\n" +#ifdef WITH_DEBUG_SELF_COMPARISON + << " --debug-abidiff debug the process of comparing the loaded ABI against itself\n" +#endif << " --annotate annotate the ABI artifacts emitted in the output\n" << " --stats show statistics about various internal stuff\n" << " --verbose show verbose messages about internal stuff\n"; @@ -328,6 +339,13 @@ parse_command_line(int argc, char* argv[], options& opts) opts.linux_kernel_mode = false; else if (!strcmp(argv[i], "--abidiff")) opts.abidiff = true; +#ifdef WITH_DEBUG_SELF_COMPARISON + else if (!strcmp(argv[i], "--debug-abidiff")) + { + opts.abidiff = true; + opts.debug_abidiff = true; + } +#endif else if (!strcmp(argv[i], "--annotate")) opts.annotate = true; else if (!strcmp(argv[i], "--stats")) @@ -467,11 +485,16 @@ static int load_corpus_and_write_abixml(char* argv[], environment_sptr& env, read_context_sptr& context, - const options& opts) + options& opts) { int exit_code = 0; timer t; +#ifdef WITH_DEBUG_SELF_COMPARISON + if (opts.debug_abidiff) + env->self_comparison_debug_is_on(true); +#endif + read_context& ctxt = *context; corpus_sptr corp; dwarf_reader::status s = dwarf_reader::STATUS_UNKNOWN; @@ -551,10 +574,13 @@ load_corpus_and_write_abixml(char* argv[], set_ostream(*write_ctxt, tmp_file->get_stream()); write_corpus(*write_ctxt, corp, 0); tmp_file->get_stream().flush(); + + xml_reader::read_context_sptr read_ctxt = + create_native_xml_read_context(tmp_file->get_path(), env.get()); + t.start(); corpus_sptr corp2 = - read_corpus_from_native_xml_file(tmp_file->get_path(), - env.get()); + read_corpus_from_input(*read_ctxt); t.stop(); if (opts.do_log) emit_prefix(argv[0], cerr)