From patchwork Tue Jul 9 03:25:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 257632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9FD882C02C1 for ; Tue, 9 Jul 2013 13:25:56 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=HPRGg7TJ2uXl0vkKT74gtEBXPTjKFzROeCPXDpNdJGG WcIACqt1J8p3+lRrOy7VNKyt7v/cszZyNiMqXRiVH1jUhdSpQfgAOpxvNEvGckVo oVNp25YZWxDO4MVHoopgFKNRUYbWPS2PB5gVPs+EYD/U1sDsEa5lX2SovPTAx37o = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=I6oIB1rdrBlZxn3TYdZBeNCEvp8=; b=hqddnB5e2XAgScetO gYCkddmHjdbE3N18iVoairCPaynb3iTNfmw94SbIJOEDSM77rKOcsqSmcG+z8/EL S6ib0/8ByQLTV0+/hCu47bjqPJl1C9OQuPjB97D1BMXdQxgNuTUyvCk+oQe1iC7g 1d7CAuLbgjdhvGQMlaIVS33Sdc= Received: (qmail 24850 invoked by alias); 9 Jul 2013 03:25:50 -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 24839 invoked by uid 89); 9 Jul 2013 03:25:50 -0000 X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 09 Jul 2013 03:25:49 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r693Pl63029756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Jul 2013 23:25:48 -0400 Received: from [10.3.113.19] ([10.3.113.19]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r693PkFi029557; Mon, 8 Jul 2013 23:25:47 -0400 Message-ID: <51DB82BA.1030107@redhat.com> Date: Mon, 08 Jul 2013 23:25:46 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0a2 MIME-Version: 1.0 To: Richard Biener CC: Lawrence Crowl , gcc-patches List Subject: RFA: PATCH to restore old behavior of debug_vec_tree X-Virus-Found: No Lawrence's overhaul of the debug() functions changed the behavior of the pvt macro in gdbinit.in. Previously it used print_node to dump each of the elements of the vector, but after the change it uses debug, which both prints less information by default and fails to handle many C++ tree nodes. Fixed by adding debug_raw for vec and changing debug_vec_tree to use that. OK for trunk? commit 682cd181d980513bc1ecd30874c5c2aaceb3b725 Author: Jason Merrill Date: Mon Jul 8 16:02:50 2013 -0400 * print-tree.c (debug_vec_tree): Use debug_raw. (debug_raw (vec &)): New. (debug_raw (vec *)): New. * tree.h: Declare them. diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 689eeb9..029c3a2 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1097,26 +1097,37 @@ debug_body (const tree_node *ptr) down to a depth of six. */ DEBUG_FUNCTION void -debug_vec_tree (vec *vec) +debug_raw (vec &ref) { tree elt; unsigned ix; /* Print the slot this node is in, and its code, and address. */ fprintf (stderr, "address ()); + dump_addr (stderr, " ", ref.address ()); - FOR_EACH_VEC_ELT (*vec, ix, elt) + FOR_EACH_VEC_ELT (ref, ix, elt) { fprintf (stderr, "elt %d ", ix); - debug (elt); + debug_raw (elt); } } DEBUG_FUNCTION void debug (vec &ref) { - debug_vec_tree (&ref); + tree elt; + unsigned ix; + + /* Print the slot this node is in, and its code, and address. */ + fprintf (stderr, " *ptr) else fprintf (stderr, "\n"); } + +DEBUG_FUNCTION void +debug_raw (vec *ptr) +{ + if (ptr) + debug_raw (*ptr); + else + fprintf (stderr, "\n"); +} + +DEBUG_FUNCTION void +debug_vec_tree (vec *vec) +{ + debug_raw (vec); +} diff --git a/gcc/tree.h b/gcc/tree.h index 6297b49..0058a4b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -6025,6 +6025,8 @@ extern void debug_body (const tree_node *ptr); extern void debug_vec_tree (vec *); extern void debug (vec &ref); extern void debug (vec *ptr); +extern void debug_raw (vec &ref); +extern void debug_raw (vec *ptr); #ifdef BUFSIZ extern void dump_addr (FILE*, const char *, const void *); extern void print_node (FILE *, const char *, tree, int);