In [live, not core-file] gdb, try this:

(gdb) p pifi(pool, <index>)

Which will tell you if <index> is free (invalid) or not (valid).

Also:

(gdb) p pool_elts(pool)

To see how many elements are in the pool.

Finally:

(gdb) p vl(pool)

To what vec_len(pool) is.

HTH... Dave

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Satya Murthy
Sent: Monday, May 4, 2020 3:13 PM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] accessing pool entries in gdb

Having some issue while accessing entries of a pool in GDB.

I have a pool of some structures.

custom_struct *pool;
This custom_struct has alignment with 64 byte cache_line.

now, I have added 3 entries in this pool. The code seems to be working fine in 
adding/deleting/traversing this pool using pool_elt_at_index.

However, If i use gdb to view the elements using pool[0], pool[1] and pool[2], 
they are giving some invalid entries.
The first entry pool[0] seem to be fine, but the next entry onwards are showing 
invalid entries in GDB.

Is there anything wrong i am doing in gdb while traversing the pools ?

--
Thanks & Regards,
Murthy
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16233): https://lists.fd.io/g/vpp-dev/message/16233
Mute This Topic: https://lists.fd.io/mt/73982726/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to