From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8256 invoked by alias); 10 Sep 2010 19:57:02 -0000 Received: (qmail 8243 invoked by uid 22791); 10 Sep 2010 19:57:01 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Sep 2010 19:56:57 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8AJut9W021539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Sep 2010 15:56:55 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8AJutNm018836; Fri, 10 Sep 2010 15:56:55 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o8AJusjm011317; Fri, 10 Sep 2010 15:56:54 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id EF7533792BD; Fri, 10 Sep 2010 13:56:53 -0600 (MDT) From: Tom Tromey To: "Kenneth Rose" Cc: gdb@sourceware.org Subject: Re: Cast to result of whatis expression References: <784f56871ebbe612785c8be91771a9a5.squirrel@webmail.kenrose.org> <35cb13dde5f183ce57b117e677709dd0.squirrel@webmail.kenrose.org> Date: Fri, 10 Sep 2010 19:57:00 -0000 In-Reply-To: <35cb13dde5f183ce57b117e677709dd0.squirrel@webmail.kenrose.org> (Kenneth Rose's message of "Fri, 10 Sep 2010 14:09:27 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00068.txt.bz2 Kenneth> Thanks Tom. Unfortunately, this is for a bunch of developers Kenneth> and I can't make everyone upgrade to GDB 7.2. That said, when Kenneth> I was researching how to do this, the Python stuff looked uber Kenneth> sexy (and uber practical). Yeah. Try harder to upgrade! Kenneth> I played around with sending the result of "whatis foo" to a shell Kenneth> command, but couldn't figure out how to actually pass an Kenneth> argument to the inferior shell with gdb. The way to do complicated scripting in pre-python gdb is horrible: 1. Use set logging to write to a temporary file. 2. Run a gdb command that generates the output you need. 3. Use "shell" (and the scripting of your choice: sed, awk, perl...) to rewrite the temp file to a second temp file that is in gdb CLI syntax. 4. "source" the second temp file Kenneth> I just need to manually copy and paste it myself as an argument Kenneth> to pvector. Since I run gdb in emacs, this is pretty easy. Of course, you could hack gud-mode to do this automatically :-) Tom