From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16325 invoked by alias); 17 Mar 2003 23:06:34 -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 16275 invoked from network); 17 Mar 2003 23:06:34 -0000 Received: from unknown (HELO mout0.freenet.de) (194.97.50.131) by sources.redhat.com with SMTP; 17 Mar 2003 23:06:34 -0000 Received: from [194.97.50.135] (helo=mx2.freenet.de) by mout0.freenet.de with asmtp (Exim 4.14) id 18v3gf-00060X-FL; Tue, 18 Mar 2003 00:06:33 +0100 Received: from b7506.pppool.de ([213.7.117.6] helo=gateway.beyer.dyndns.org) by mx2.freenet.de with esmtp (Exim 4.12 #2) id 18v3ge-0007vt-00; Tue, 18 Mar 2003 00:06:33 +0100 Received: from web.de (dilbert.beyer.dyndns.org [10.0.0.2]) by gateway.beyer.dyndns.org (Postfix) with ESMTP id 4380414DAB; Tue, 18 Mar 2003 00:02:38 +0100 (CET) Message-ID: <3E76540D.10302@web.de> Date: Mon, 17 Mar 2003 23:06:00 -0000 From: joerg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: de-de, en-us MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: how to access array elements? References: <200303171102.h2HB2C309956@mailgate5.cinetic.de> <20030317140001.GA29110@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00266.txt.bz2 Daniel Jacobowitz wrote: > 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 function is not commented. Is this suggested comment correct? /* * gdb_value_s returns an array element as value. * val1 is the array * val2 is the index * rval is the result, the array element */ int gdb_value_subscript (struct value *val1, struct value *val2, struct value **rval) yours Joerg