From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30815 invoked by alias); 17 Mar 2003 14:31:24 -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 30767 invoked from network); 17 Mar 2003 14:31:23 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 17 Mar 2003 14:31:23 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18uxXU-0002tL-00; Mon, 17 Mar 2003 10:32:40 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18uve2-0007o6-00; Mon, 17 Mar 2003 09:31:18 -0500 Date: Mon, 17 Mar 2003 14:31:00 -0000 From: Daniel Jacobowitz To: Joerg Beyer Cc: gdb@sources.redhat.com Subject: Re: Re: how to access array elements? Message-ID: <20030317143118.GA29995@nevyn.them.org> Mail-Followup-To: Joerg Beyer , gdb@sources.redhat.com References: <200303171416.h2HEGv302645@mailgate5.cinetic.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200303171416.h2HEGv302645@mailgate5.cinetic.de> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-03/txt/msg00252.txt.bz2 On Mon, Mar 17, 2003 at 03:16:57PM +0100, Joerg Beyer wrote: > Daniel Jacobowitz schrieb am 17.03.03 15:00:15: > > > > On Mon, Mar 17, 2003 at 12:02:12PM +0100, Joerg Beyer wrote: > > > Dear List Reader, > > > > > > while fiddeling with the gdb-sources, I want to iterate over the > > > values of an array. I have the "struct value*"-pointer, that is a > > > TYPE_CODE_ARRAY. How do I get value-pointers to the > > > entries of the array? > > > > Try value_subscript? > > this one: > struct value *value_subscript (struct value *array, struct value *idx) ? > it needs a value pointer as index. could I easily turn a int/long/... into > such a value? > > I cant find a int_to_value() or something function. value_from_longest? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer