pandora-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pandora] What is the supossed way to locate a Component in the same


From: Simon Patarin
Subject: Re: [Pandora] What is the supossed way to locate a Component in the same stack???
Date: Wed, 24 Sep 2003 12:55:27 +0200 (CEST)


> you mean something like this?

yes :)

> (gdb) print compStack->store
> $2 = (CompRefStore *) 0x84bcc80
> (gdb) print compStack->store->store
> $3 = (class Set<Component *> *) 0x84180a8
> (gdb) print compStack->store->store->_array
> $4 = (class Component **) 0x8419938
> (gdb) print compStack->store->store->_array[0]
> $5 = (Component *) 0x0 <--- what happens here?
> (gdb) print compStack->store->store->_array[1]
> $6 = (Component *) 0x0 <--- and here?
>
> this printing has been done after Component initialization, in the :add
> method (in the constructor compStack is NULL)
>
> Any comment?

don't panic! :) the compStack->store->store[] is actually some sort of a
hash table (this choice may be disscussed, but that's the way it is by
now). So let's have a look at my own gdb session:

(gdb) print compStack->store->store->_array
$4 = (class Component **) 0x808a5f8
(gdb) print compStack->store->store->_array[0]
$5 = (class Component *) 0x0
(gdb) print compStack->store->store->_array[1]
$6 = (class Component *) 0x0
(gdb) print compStack->store->store->_array[2]
$7 = (class Component *) 0x0
(gdb) print compStack->store->store->_array[3]
$8 = (class Component *) 0x0
(gdb) print compStack->store->store->_array[4]
$9 = (class Component *) 0x808a638
(gdb) print compStack->store->store->_array[5]
$10 = (class Component *) 0x0
(gdb) print compStack->store->store->_array[6]
$11 = (class Component *) 0x0
(gdb) print *(compStack->store->store)
$12 = {_vptr.Set = 0x4007b190, _tally = 1, _array = 0x808a5f8, _capacity =
7,  _undefined = 0x0}

Here, you can see that the actual pointer is stored in the fifth slot of
the hash table (which has a capacity of 7). You need to use the utilities
defined in set.h to access these things easily.

Simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]