From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94209 invoked by alias); 5 Apr 2015 17:01:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 94198 invoked by uid 89); 5 Apr 2015 17:01:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 05 Apr 2015 17:01:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t35H1VIm000808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 5 Apr 2015 13:01:31 -0400 Received: from host1.jankratochvil.net (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t35H1QRB028043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Apr 2015 13:01:30 -0400 Date: Sun, 05 Apr 2015 17:01:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Phil Muldoon Subject: cancel: [PATCH 4/4] compile: New 'compile print' Message-ID: <20150405170125.GA8246@host1.jankratochvil.net> References: <20150326205727.28223.54648.stgit@host1.jankratochvil.net> <20150326205752.28223.24230.stgit@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150326205752.28223.24230.stgit@host1.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00142.txt.bz2 On Thu, 26 Mar 2015 21:57:52 +0100, Jan Kratochvil wrote: > + fprintf_unfiltered (buf, > +"__auto_type " COMPILE_I_EXPR_VAL " = %s;\n" > +"typeof (%s) *" COMPILE_I_EXPR_PTR_TYPE ";\n" > +"if (" COMPILE_I_PRINT_EXPR_TAKE_ADDRESS ")\n" > +"\tmemcpy (" COMPILE_I_PRINT_OUT_ARG ", &" COMPILE_I_EXPR_VAL ",\n" > + "sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n" > +"else\n" > +"\tmemcpy (" COMPILE_I_PRINT_OUT_ARG ", " COMPILE_I_EXPR_VAL ",\n" > + "sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n" > + , input, input); This cannot work, when trying to print struct variable GCC fails for the second memcpy() with: gdb command line:7:2: error: cannot convert to a pointer type^M It will need to perform two compilation steps (or just one if the first one is the right kind). Jan