From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84249 invoked by alias); 19 Nov 2017 22:45:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 84239 invoked by uid 89); 19 Nov 2017 22:45:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-6.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=most, SI, we, here=c2?= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Nov 2017 22:45:41 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D4FC356E3 for ; Sun, 19 Nov 2017 22:45:40 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41A5660BE0; Sun, 19 Nov 2017 22:45:38 +0000 (UTC) Subject: Re: PING Fwd: [patch] implement generic debug() for vectors and hash sets To: Aldy Hernandez , gcc-patches References: From: Jeff Law Message-ID: Date: Sun, 19 Nov 2017 22:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg01689.txt.bz2 On 10/23/2017 03:44 AM, Aldy Hernandez wrote: > > > > -------- Forwarded Message -------- > Subject: [patch] implement generic debug() for vectors and hash sets > Date: Mon, 16 Oct 2017 09:52:51 -0400 > From: Aldy Hernandez  > To: gcc-patches  > > We have a generic mechanism for dumping types from the debugger with: > > (gdb) call debug(some_type) > > However, even though most types are implemented, we have no canonical > way of dumping vectors or hash sets. > > The attached patch fixes this oversight.  With it you can call > debug(vec<>) and debug(hash_set<>) with the following types: rtx, > tree, basic_block, edge, rtx_insn.  More can be added simply by adding > a debug_slim(your_type) overload and calling: > >   DEFINE_DEBUG_VEC (your_type) >   DEFINE_DEBUG_HASH_SET (your_type) > > Here is an example of how things look with this patch: > > vec of edges: > [0] =  10)> > > vec of bbs: > [0] =  > [1] =  > > vec of trees: > [0] =   > [1] =   > [2] =   > > vec of rtx: > [0] = (reg:SI 87) > [1] = (reg:SI 87) > > hash of bbs: > > > > OK for mainline? > > > curr.patch > > > gcc/ > > * vec.h (debug_helper): New function. > (DEFINE_DEBUG_VEC): New macro. > * hash-set.h (debug_helper): New function. > (DEFINE_DEBUG_HASH_SET): New macro. > * cfg.c (debug_slim (edge)): New function. > Call DEFINE_DEBUG_VEC for edges. > Call DEFINE_DEBUG_HASH_SET for edges. > * cfghooks.c (debug_slim (basic_block)): New function. > Call DEFINE_DEBUG_VEC for basic blocks. > Call DEFINE_DEBUG_HASH_SET for basic blocks. > * print-tree.c (debug_slim): New function to handle trees. > Call DEFINE_DEBUG_VEC for trees. > Call DEFINE_DEBUG_HASH_SET for trees. > (debug (vec) &): Remove. > (debug () *): Remove. > * print-rtl.c (debug_slim): New function to handle const_rtx. > Call DEFINE_DEBUG_VEC for rtx_def. > Call DEFINE_DEBUG_VEC for rtx_insn. > Call DEFINE_DEBUG_HASH_SET for rtx_def. > Call DEFINE_DEBUG_HASH_SET for rtx_insn. > * sel-sched-dump.c (debug (vec &): Remove. > (debug (vec *ptr): Remove. > (debug_insn_vector): Remove. > * stor-layout.c (debug_rli): Call debug() instead of debug_vec_tree. OK. jeff