This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC - Python Scripting] New method gdb.Symtab.blocks_iterator - docs included


Hello,

While the work on Objfile.symtabs (or Objfile.iterator) is pending, I
want to complete the API for the exploratory path Objfile => Symtabs
=> Blocks => Symbols.  This patch adds the missing link Symtabs =>
Blocks.  The method Symtab.blocks_iterator returns an iterator to
iterate over the scope blocks of a symtab.  The patch is attached and
the ChangeLog is as follows:

Code -
2012-04-09  Siva Chandra Reddy  <sivachandra@google.com>

        Add a new method gdb.Symtab.blocks_iterator to iterate
        over the scope blocks of a symbol table.
        * NEWS (Python scripting): Add entry about the new method.
        * python/py-symtab.c (symtab_blocks_iterator_object): New
        iterator type to iterate over the scope blocks of a symtab.
        (stpy_blocks_iterator): New function which implements the
        new method.
        (symtab_blocks_iterator_dealloc): New function which serves
        as the tp_dealloc function for symtab_blocks_iterator_object.
        (symtab_blocks_iterator_iter): New function which serves as
        the tp_iter function for symtab_blocks_iterator_object.
        (symtab_blocks_iterator_iternext): New function which serves as
        the tp_iternext function for symtab_blocks_iterator_object.
        (gdbpy_initialize_symtabs): Add initializations for the new
        iterator type.

Docs -
2012-04-09  Siva Chandra Reddy  <sivachandra@google.com>

        * gdb.texinfo (Symbol Tables In Python): Add description about
        the new method gdb.Symtab.blocks_iterator.

Tests -
2012-04-09  Siva Chandra Reddy  <sivachandra@google.com>

        * gdb.python/py-symtab.exp: Add tests to test the new method
        gdb.Symtab.blocks_iterator.

Thanks,
Siva Chandra

Attachment: blocks_iterator_patch_v1.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]