public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* how to access array elements?
@ 2003-03-17 11:02 Joerg Beyer
  2003-03-17 14:00 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Beyer @ 2003-03-17 11:02 UTC (permalink / raw)
  To: gdb

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?

    thanks in advance
    Joerg

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to access array elements?
  2003-03-17 11:02 how to access array elements? Joerg Beyer
@ 2003-03-17 14:00 ` Daniel Jacobowitz
  2003-03-17 23:06   ` joerg
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-03-17 14:00 UTC (permalink / raw)
  To: Joerg Beyer; +Cc: gdb

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?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to access array elements?
  2003-03-17 14:00 ` Daniel Jacobowitz
@ 2003-03-17 23:06   ` joerg
  2003-03-18  0:49     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: joerg @ 2003-03-17 23:06 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to access array elements?
  2003-03-17 23:06   ` joerg
@ 2003-03-18  0:49     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-03-18  0:49 UTC (permalink / raw)
  To: joerg; +Cc: gdb

On Tue, Mar 18, 2003 at 12:02:37AM +0100, joerg wrote:
> 
> 
> 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?

I don't know - note that I suggested value_subscript, not
gdb_value_subscript.  I guess it depends what you're doing.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-18  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-17 11:02 how to access array elements? Joerg Beyer
2003-03-17 14:00 ` Daniel Jacobowitz
2003-03-17 23:06   ` joerg
2003-03-18  0:49     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).