From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3322 invoked by alias); 5 Dec 2001 11:43:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3143 invoked from network); 5 Dec 2001 11:43:15 -0000 Received: from unknown (HELO is.elta.co.il) (199.203.121.2) by sources.redhat.com with SMTP; 5 Dec 2001 11:43:15 -0000 Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id NAA07647; Wed, 5 Dec 2001 13:42:25 +0200 (IST) Date: Wed, 05 Dec 2001 03:43:00 -0000 From: Eli Zaretskii X-Sender: eliz@is To: "Howind Axel, Externer Dienstleister" cc: "'gdb@sources.redhat.com'" Subject: Re: expanding c-macros in gdb In-Reply-To: <6380966D8BCFD5119C9300306E1C8487057727@clg-server7.clg.fja.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-12/txt/msg00027.txt.bz2 On Wed, 5 Dec 2001, Howind Axel, Externer Dienstleister wrote: > Is there a way to make gdb understand that the command > print REFP_XYZ(a).abc is the same as print xyz_ptr->s_xyz.r_xyz[i].xyz.abc? > > I have read in the gcc manual that compiling with -g3 stores information > about all defined macros, so that "Some debuggers support macro > expansion when you use `-g3'." > This does not seem to work with gdb (gcc 2.95.2, gdb 5.0, on HP-UX 10.20). Try compiling with -gdwarf-2 or -gstabs+ instead of -g3. Perhaps that would help (I have no idea whether DWARF2 is supported on HP-UX). > define printmac(arg) > print `echo $arg | sed -f transform` You want to invoke cpp, not Sed, I think: macro expansion is not a simple text substitution.