From patchwork Thu Oct 14 07:14:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 46197 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 609FF3858414 for ; Thu, 14 Oct 2021 07:15:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 609FF3858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1634195712; bh=+KcE0/g9XJ2V8/VWAhxKqoYSbIRASsMnYojQKFVJUCQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l9xrmhSN9f9Ncy2fSOJaIDovSoFO5xibYdRCPVEUIpfCw99sI1+lxU07YOLwa+kU0 VBEGTMFneKkaU0M7HQHyLfDdtSFx6vqRcjTDZ53EecugbDbVZPeVj/QHg3ezNlIUuD 7aPbHfgoeI0opKHZSCZ7jTWZhsGkyjEW6F7oWVRg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 80EE0385800B for ; Thu, 14 Oct 2021 07:14:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80EE0385800B 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-44-wqy5rd2BNBiYWV6bXJmfNA-1; Thu, 14 Oct 2021 03:14:31 -0400 X-MC-Unique: wqy5rd2BNBiYWV6bXJmfNA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DBFC1217187 for ; Thu, 14 Oct 2021 07:14:30 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.225]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B07CF80464; Thu, 14 Oct 2021 07:14:29 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 19E7EQ6L205279 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 09:14:27 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 19E7EQjb205278; Thu, 14 Oct 2021 09:14:26 +0200 To: GCC patches Subject: [PATCH] Add debug helpers for auto_bitmap. Date: Thu, 14 Oct 2021 09:14:17 +0200 Message-Id: <20211014071417.205211-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.1 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Using debug() on an auto_bitmap from gdb doesn't work because the implicit conversion from auto_bitmap to bitmap_head doesn't work from within a debugging session. This patch adds the convenience functions for auto_bitmap. OK? --- gcc/bitmap.c | 12 ++++++++++++ gcc/bitmap.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/gcc/bitmap.c b/gcc/bitmap.c index b915fdfbb54..98c6d0b9e05 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -2830,6 +2830,18 @@ debug (const bitmap_head *ptr) fprintf (stderr, "\n"); } +DEBUG_FUNCTION void +debug (const auto_bitmap &ref) +{ + debug ((const bitmap_head &) ref); +} + +DEBUG_FUNCTION void +debug (const auto_bitmap *ptr) +{ + debug ((const bitmap_head *) ptr); +} + void bitmap_head::dump () { diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 0846f79665d..1bddcdbfaee 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -964,6 +964,9 @@ class auto_bitmap bitmap_head m_bits; }; +extern void debug (const auto_bitmap &ref); +extern void debug (const auto_bitmap *ptr); + /* Base class for bitmap_view; see there for details. */ template > class base_bitmap_view