From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DD1E23858C2B for ; Thu, 24 Aug 2023 14:39:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD1E23858C2B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692887947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JBsvKAB0kg5PtZC1GwAGQAAxTZybXy7EdQeOl8dfxVM=; b=SbJYt0v/Ol/RfHXeYvOfZMBL9I4oGPxVA1KRsg3K2svjUbrH9dxZO6tQPRAHPYNOS3GoSC OjO9hxIb+3Ne7w5AGqzwKSMovXK/p3WJdZqkK9m/oeKLfUBz6dJ4wYRi3WE2gBAMD1Zpla TyvxY1kAARXoG3qjX3RD6646d+i65dE= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-311-XIkD-TZGMzmmmKc0nnNgWg-1; Thu, 24 Aug 2023 10:39:06 -0400 X-MC-Unique: XIkD-TZGMzmmmKc0nnNgWg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09C8C3C14AAA for ; Thu, 24 Aug 2023 14:39:06 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.32.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id D738340D283C; Thu, 24 Aug 2023 14:39:05 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 1/9] analyzer: add logging to impl_path_context Date: Thu, 24 Aug 2023 10:38:55 -0400 Message-Id: <20230824143903.3161185-2-dmalcolm@redhat.com> In-Reply-To: <20230824143903.3161185-1-dmalcolm@redhat.com> References: <20230824143903.3161185-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: gcc/analyzer/ChangeLog: * engine.cc (impl_path_context::impl_path_context): Add logger param. (impl_path_context::bifurcate): Add log message. (impl_path_context::terminate_path): Likewise. (impl_path_context::m_logger): New field. (exploded_graph::process_node): Pass logger to path_ctxt ctor. --- gcc/analyzer/engine.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 3700154eec2c..a1908cdb364e 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -3848,8 +3848,10 @@ exploded_graph::maybe_create_dynamic_call (const gcall *call, class impl_path_context : public path_context { public: - impl_path_context (const program_state *cur_state) + impl_path_context (const program_state *cur_state, + logger *logger) : m_cur_state (cur_state), + m_logger (logger), m_terminate_path (false) { } @@ -3868,6 +3870,9 @@ public: void bifurcate (std::unique_ptr info) final override { + if (m_logger) + m_logger->log ("bifurcating path"); + if (m_state_at_bifurcation) /* Verify that the state at bifurcation is consistent when we split into multiple out-edges. */ @@ -3884,6 +3889,8 @@ public: void terminate_path () final override { + if (m_logger) + m_logger->log ("terminating path"); m_terminate_path = true; } @@ -3900,6 +3907,8 @@ public: private: const program_state *m_cur_state; + logger *m_logger; + /* Lazily-created copy of the state before the split. */ std::unique_ptr m_state_at_bifurcation; @@ -4044,7 +4053,7 @@ exploded_graph::process_node (exploded_node *node) exactly one stmt, the one that caused the change. */ program_state next_state (state); - impl_path_context path_ctxt (&next_state); + impl_path_context path_ctxt (&next_state, logger); uncertainty_t uncertainty; const supernode *snode = point.get_supernode (); -- 2.26.3