From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27418 invoked by alias); 12 Feb 2002 16:33:07 -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 27293 invoked from network); 12 Feb 2002 16:33:02 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 12 Feb 2002 16:33:02 -0000 Received: from cse.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id IAA14521; Tue, 12 Feb 2002 08:32:49 -0800 (PST) Received: (from kev@localhost) by cse.cygnus.com (8.11.6/8.11.6) id g1CGVsI01431; Tue, 12 Feb 2002 09:31:54 -0700 Date: Tue, 12 Feb 2002 08:33:00 -0000 From: Kevin Buettner Message-Id: <1020212163153.ZM1430@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: set $argv = *argv@100" (Feb 12, 10:32am) References: <3C68AC89.4030807@cygnus.com> <1020212062154.ZM31975@localhost.localdomain> <3C69357A.4030805@cygnus.com> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: Andrew Cagney Subject: Re: set $argv = *argv@100 Cc: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00186.txt.bz2 On Feb 12, 10:32am, Andrew Cagney wrote: > > I think the address is right. The problem is that $argv isn't the right > > type. According to the above, it's ``char **'' when it should be > > ``char *[100]''. > > > > Try this: > > > > (top-gdb) set $argva = &(*argv@100) > > (top-gdb) print $argva > > $23 = (char *(*)[100]) 0xbffff99c > > (top-gdb) ptype $argva > > type = char *(*)[100] > > (top-gdb) ptype *$argva > > type = char *[100] > > > > Kevin > > Yes, C strikes again. You can't copy an array, just its address :-( I still think it'd be nice if we could somehow preserve the type when doing set $argv = *argv@100... (top-gdb) set $argv = *argv@100 (top-gdb) ptype $argv type = char ** (top-gdb) ptype *argv@100 type = char *[100] I.e, it'd be nice if the types of $argv and *argv@100 were the same. I haven't thought this through though. It could be that a lot of other stuff would break if we did this. Kevin