From patchwork Mon Sep 6 17:46:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 63949 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]) by ozlabs.org (Postfix) with SMTP id D1510B70F4 for ; Tue, 7 Sep 2010 03:47:16 +1000 (EST) Received: (qmail 28137 invoked by alias); 6 Sep 2010 17:47:09 -0000 Received: (qmail 28114 invoked by uid 22791); 6 Sep 2010 17:47:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 17:47:01 +0000 Received: from [192.168.178.22] (port-92-204-40-202.dynamic.qsc.de [92.204.40.202]) by mx02.qsc.de (Postfix) with ESMTP id A78041EBCF; Mon, 6 Sep 2010 19:46:58 +0200 (CEST) Message-ID: <4C852912.3080505@net-b.de> Date: Mon, 06 Sep 2010 19:46:58 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.7) Gecko/20100714 SUSE/3.1.1 Thunderbird/3.1.1 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran] PR 45560 - add EXPR pretty printer (gfc_debug_expr) 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 Richard stated in #gcc that he misses a pretty printer for gfc_expr. The attached patch adds one. To be used in the debugger - otherwise, the function is not called. Build on x86-64-linux. OK for the trunk? Tobias 2010-09-06 Tobias Burnus PR fortran/45560 * dump-parse-tree.c (gfc_debug_expr): New function. Index: gcc/fortran/dump-parse-tree.c =================================================================== --- gcc/fortran/dump-parse-tree.c (Revision 163924) +++ gcc/fortran/dump-parse-tree.c (Arbeitskopie) @@ -49,6 +49,20 @@ static void show_namespace (gfc_namespace *ns); +/* Allow dumping of an expression in the debugger. */ +void gfc_debug_expr (gfc_expr *); + +void +gfc_debug_expr (gfc_expr *e) +{ + FILE *tmp = dumpfile; + dumpfile = stdout; + show_expr (e); + fputc ('\n', dumpfile); + dumpfile = tmp; +} + + /* Do indentation for a specific level. */ static inline void