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]

Re: [RFC - Python scripting] New methods Symtab.global_block and Symtab.static_block (docs included)


>> +@defun Symtab.global_block ()
>> +Return the global block of the underlying symbol table.  Note that,
>> +though highly unlikely, the returned @code{gdb.Block} objects are not
>> +guaranteed to be identical across different @value{GDBN} releases.
>> +@end defun
>> +
>> +@defun Symtab.static_block ()
>> +Return the static block of the underlying symbol table.  Note that,
>> +though highly unlikely, the returned @code{gdb.Block} objects are not
>> +guaranteed to be identical across different @value{GDBN} releases.
>> +@end defun

Eli> I think it would be a good idea to have here a cross-reference to
Eli> "Blocks in Python".
Eli>
Eli> Also, the 2 identical sentences about the objects not being preserved
Eli> across GDB releases should probably be replaced by just one sentence,
Eli> saying this for both types of blocks.

Thanks Eli, for taking a look.  I have modified according to your
comments.  I would like you to take a look at the doc changes again
since the suggestion wasn't objective for the second change.
ChangeLog correction pointed to by Phil, and the use of accessor
macros as suggested by Tom, are also in the attached patch.

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

       Add two new methods global_block and static_block to gdb.Symtab
       objects.
       * NEWS (Python scripting): Add entry about the new methods.
       * python/py-symtab.c (stpy_global_block): New function which
       implements the gdb.Symtab.global_block() method.
       (stpy_static_block): New function which implements the
       gdb.Symtab.static_block() method.
       (symtab_object_methods): Add entries for the two new methods.

Testsuite:
2012-04-18  Siva Chandra Reddy  <sivachandra@google.com>

       * gdb.python/py-symbol.exp: Add tests to test the new methods
       gdb.Symtab.global_block() and gdb.Symtab.static_block().
       * gdb.python/py-symbol.c: Add new struct to help test
       gdb.Symtab.static_block().

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

       * gdb.texinfo (Symbol Tables In Python): Add documentation about
       the new methods global_block and static_block on gdb.Symtab
       objects.

Thanks,
Siva Chandra

Attachment: symtab_blocks_patch_v2.txt
Description: Text document


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