This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Re: how to access array elements?
- From: "Joerg Beyer" <j dot beyer at web dot de>
- To: "DanielJacobowitz" <drow at mvista dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 17 Mar 2003 15:16:57 +0100
- Subject: Re: Re: how to access array elements?
- Organization: http://freemail.web.de/
Daniel Jacobowitz <drow at mvista dot com> 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.
Joerg