Re: Pythons scripting API question

Tom Tromey
2012-06-06T17:58:16Z

>>>>> "Joachim" == Joachim Protze <joachim.protze@tu-dresden.de> writes:

Joachim> Thank you for this example!
Joachim> I never figured out this feature of Blocks :(

Keith> See the relevant sections in the Gdb Users Manual (23.2.2.16, 23.2.2.18).

Joachim> I totally miss the hint that Blocks drop Value objects on iteration in
Joachim> the documentation.

It was patched to be more clear:

2012-02-22 Tom Tromey <tromey@redhat.com>

* gdb.texinfo (Blocks In Python): Clarify block iteration.

The new text says:

A @code{gdb.Block} is iterable. The iterator returns the symbols
(@pxref{Symbols In Python}) local to the block. [...]

If this is insufficient, suggest more...

Joachim> How to access the "hierarchically organized" sub-blocks?

Unfortunately we are missing API for this.
Could you file a bug report for it?

Or alternatively, try to write it? I don't think gdb has a direct way
to iterate over sub-blocks; but at the very least you can iterate over
the blockvector and look for blocks with a certain parent.

Tom