From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16872 invoked by alias); 30 Nov 2001 03:00:48 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 16815 invoked from network); 30 Nov 2001 03:00:46 -0000 Received: from unknown (HELO boden.synopsys.com) (204.176.20.19) by hostedprojects.ges.redhat.com with SMTP; 30 Nov 2001 03:00:46 -0000 Received: from mother.synopsys.com (mother.synopsys.com [146.225.100.171]) by boden.synopsys.com (Postfix) with ESMTP id 7A1D2DAA6; Thu, 29 Nov 2001 19:00:45 -0800 (PST) Received: from atrus.synopsys.com (localhost [127.0.0.1]) by mother.synopsys.com (8.9.1/8.9.1) with ESMTP id TAA02248; Thu, 29 Nov 2001 19:00:34 -0800 (PST) From: Joe Buck Received: (from jbuck@localhost) by atrus.synopsys.com (8.9.3+Sun/8.9.1) id TAA05503; Thu, 29 Nov 2001 19:00:44 -0800 (PST) Message-Id: <200111300300.TAA05503@atrus.synopsys.com> Subject: Re: fdump-ast-original and strg: To: guillaume.thouvenin@polymtl.ca (Guillaume) Date: Thu, 22 Nov 2001 13:14:00 -0000 Cc: gcc@gcc.gnu.org In-Reply-To: from "Guillaume" at Nov 29, 2001 09:47:08 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg01111.txt.bz2 Guillaume Thouvenin writes: ... > The problem is the following. If you have something like: > > -- part of a C code -- > > fprintf(stderr, "error strg: toto"); > > -- > > The asg given by gcc gives the following line: > > @247 string_cst type: @268 strg: error strg: toto lngt: 5 > > So, I add a very basic modification inside GCC (in c-dump.c) and now, it > produces this line: > > @247 string_cst type: @268 strg: "error strg: toto" lngt: 5 > > It is easier to parse. So, I'd like to know if it can be added to official > gcc futur release. It's only one line and for me it will be easier because > people won't need to recompile the gcc compiler if they want to use my > tool (ok for now I'm the only one who use it but it can change...). This seems reasonable, but does your patch do the whole job? What happens if the string contains newlines, control characters, or '"'? It would seem reasonable to make the output match the input (that is, output \", \n, etc). From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: guillaume.thouvenin@polymtl.ca (Guillaume) Cc: gcc@gcc.gnu.org Subject: Re: fdump-ast-original and strg: Date: Thu, 29 Nov 2001 19:00:00 -0000 Message-ID: <200111300300.TAA05503@atrus.synopsys.com> References: X-SW-Source: 2001-11/msg01612.html Message-ID: <20011129190000.Lb2TmS0oz5Kr1TfqVztLudfRyItazr4oSiDemxjnfFo@z> Guillaume Thouvenin writes: ... > The problem is the following. If you have something like: > > -- part of a C code -- > > fprintf(stderr, "error strg: toto"); > > -- > > The asg given by gcc gives the following line: > > @247 string_cst type: @268 strg: error strg: toto lngt: 5 > > So, I add a very basic modification inside GCC (in c-dump.c) and now, it > produces this line: > > @247 string_cst type: @268 strg: "error strg: toto" lngt: 5 > > It is easier to parse. So, I'd like to know if it can be added to official > gcc futur release. It's only one line and for me it will be easier because > people won't need to recompile the gcc compiler if they want to use my > tool (ok for now I'm the only one who use it but it can change...). This seems reasonable, but does your patch do the whole job? What happens if the string contains newlines, control characters, or '"'? It would seem reasonable to make the output match the input (that is, output \", \n, etc).