Next: Symbols In Python, Previous: Frames In Python, Up: Python API [Contents][Index]
Within each frame, GDB maintains information on each block
stored in that frame. These blocks are organized hierarchically, and
are represented individually in Python as a gdb.Block
.
Please see Frames In Python, for a more in-depth discussion on
frames. Furthermore, see Examining the Stack, for more
detailed technical information on GDB’s book-keeping of the
stack.
A gdb.Block
is iterable. The iterator returns the symbols
(see Symbols In Python) local to the block. Python programs
should not assume that a specific block object will always contain a
given symbol, since changes in GDB features and
infrastructure may cause symbols move across blocks in a symbol
table.
The following block-related functions are available in the gdb
module:
Return the gdb.Block
containing the given pc value. If the
block cannot be found for the pc value specified, the function
will return None
.
A gdb.Block
object has the following methods:
Returns True
if the gdb.Block
object is valid,
False
if not. A block object can become invalid if the block it
refers to doesn’t exist anymore in the inferior. All other
gdb.Block
methods will throw an exception if it is invalid at
the time the method is called. The block’s validity is also checked
during iteration over symbols of the block.
A gdb.Block
object has the following attributes:
The start address of the block. This attribute is not writable.
The end address of the block. This attribute is not writable.
The name of the block represented as a gdb.Symbol
. If the
block is not named, then this attribute holds None
. This
attribute is not writable.
The block containing this block. If this parent block does not exist,
this attribute holds None
. This attribute is not writable.
The global block associated with this block. This attribute is not writable.
The static block associated with this block. This attribute is not writable.
True
if the gdb.Block
object is a global block,
False
if not. This attribute is not
writable.
True
if the gdb.Block
object is a static block,
False
if not. This attribute is not writable.
Next: Symbols In Python, Previous: Frames In Python, Up: Python API [Contents][Index]