From patchwork Wed Nov 20 21:13:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1198529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514240-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fKeQMhik"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="O1YT/wyg"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47JFfq2r9tz9sPL for ; Thu, 21 Nov 2019 08:08:51 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding; q=dns; s=default; b=yUc PY2ZtH3lIdVv/a2ILK5jrwsl1De9uvFgV1lxbvqQP4sj1WXZenQ+WEv1YxTHEZkB YGDbiy867ihsTezvIGzkiul4ZLUJYNk0uxHgC4MvdObBfmRzE39j7YbhpSoQR4qg uJ1jaqX2lW/0t0PLfU1k2gaeY6TO1v7q7fIjNTQk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding; s=default; bh=+c01ij54W 0DcD+odFAUz/RqACK0=; b=fKeQMhiknvp1xOtmQMLImM40Ib687LPHLMwy0USBZ oSk2w5KQS3JIGdCS5axwpcZEUKo32rXSwtlJL3ZQlADk+aeqDwVyZ3aC5FUdTJ3A XwIrx2saZ96n2AvXdcS6FU0KHX58V1V+R69u8YM5YV2YW2tUFVFgiCNZbhAoSikM zc= Received: (qmail 86927 invoked by alias); 20 Nov 2019 21:07:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 86852 invoked by uid 89); 20 Nov 2019 21:07:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1440, *pp X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2019 21:07:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574284039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2DMofitlWcgtztf4xKFpzpY0Id4PTsFYU1xke3PGgF4=; b=O1YT/wygnVEWlcTk7N3Xzewm/mFcrSmy5imbioRPTwJbqloyU+mUlHy9jRNNEIr1KAYzN5 y23k/m6Gy0m+mskXyQ7OKcwo00GaN+8lm0BnIj5+jBWnL4Af2VNUKgfSaLLXuhoUAhRt2J MHKkxYFjMa9xYAujhFkszTouetQYc3k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-b_sEjrgcPfKIuIXF2Fp0sA-1; Wed, 20 Nov 2019 16:07:17 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E35502F2B for ; Wed, 20 Nov 2019 21:07:16 +0000 (UTC) Received: from c64.redhat.com (ovpn-112-19.phx2.redhat.com [10.3.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBE04106427B; Wed, 20 Nov 2019 21:07:15 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 09/11] [analyzer] Add checker_path::debug Date: Wed, 20 Nov 2019 16:13:48 -0500 Message-Id: <1574284430-8776-10-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1574284430-8776-1-git-send-email-dmalcolm@redhat.com> References: <1574284430-8776-1-git-send-email-dmalcolm@redhat.com> X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes This patch adds a new debugging function. gcc/ChangeLog: * analyzer/checker-path.cc (checker_path::debug): New member function. * analyzer/checker-path.h (checker_path::debug): New decl. --- gcc/analyzer/checker-path.cc | 19 +++++++++++++++++++ gcc/analyzer/checker-path.h | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc index 5302504..0a18406 100644 --- a/gcc/analyzer/checker-path.cc +++ b/gcc/analyzer/checker-path.cc @@ -883,6 +883,25 @@ checker_path::maybe_log (logger *logger, const char *desc) const } } +/* Print a multiline form of this path to STDERR. */ + +DEBUG_FUNCTION void +checker_path::debug () const +{ + checker_event *e; + int i; + FOR_EACH_VEC_ELT (m_events, i, e) + { + label_text event_desc (e->get_desc (false)); + fprintf (stderr, + "[%i]: %s \"%s\"\n", + i, + event_kind_to_string (m_events[i]->m_kind), + event_desc.m_buffer); + event_desc.maybe_free (); + } +} + /* Add a warning_event to the end of this path. */ void diff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h index f042f47..916e5a7 100644 --- a/gcc/analyzer/checker-path.h +++ b/gcc/analyzer/checker-path.h @@ -499,8 +499,8 @@ public: return *m_events[idx]; } - void dump (pretty_printer *pp) const; + void debug () const; void maybe_log (logger *logger, const char *desc) const;