Re: [patch 2/2] New 'explore' command Python implementation (with docs)

Doug Evans
2012-04-10T17:22:42Z

Playing with it a bit, I think we might want to tweak the output a bit
(remove the repetitive "... to explore this field ..."), but I don't
want to hold this patch up any longer, so I'm happy to leave that for
a later pass.

'struct dwarf2_cu' is a struct/class with the following fields:

objfile = <Enter 0 to explore this field of type
'struct objfile *'>
header = <Enter 1 to explore this field of type
'struct comp_unit_head'>
base_address = <Enter 2 to explore this field of type 'CORE_ADDR'>
base_known = <Enter 3 to explore this field of type 'int'>
language = <Enter 4 to explore this field of type
'enum language'>
language_defn = <Enter 5 to explore this field of type
'const struct language_defn *'>
producer = <Enter 6 to explore this field of type
'const char *'>
list_in_scope = <Enter 7 to explore this field of type
'struct pending **'>
dwarf2_abbrevs = <Enter 8 to explore this field of type
'struct abbrev_info **'>
abbrev_obstack = <Enter 9 to explore this field of type
'struct obstack'>
partial_dies = <Enter 10 to explore this field of type 'htab_t'>
comp_unit_obstack = <Enter 11 to explore this field of type
'struct obstack'>
read_in_chain = <Enter 12 to explore this field of type
'struct dwarf2_per_cu_data *'>
per_cu = <Enter 13 to explore this field of type
'struct dwarf2_per_cu_data *'>
last_used = <Enter 14 to explore this field of type 'int'>
die_hash = <Enter 15 to explore this field of type 'htab_t'>
dies = <Enter 16 to explore this field of type
'struct die_info *'>
dependencies = <Enter 17 to explore this field of type 'htab_t'>
line_header = <Enter 18 to explore this field of type
'struct line_header *'>
method_list = <Enter 19 to explore this field of type
'VEC_delayed_method_info *'>
call_site_htab = <Enter 20 to explore this field of type 'htab_t'>
mark = <Enter 21 to explore this field of type
'unsigned int'>
has_loclist = <Enter 22 to explore this field of type
'unsigned int'>
checked_producer = <Enter 23 to explore this field of type
'unsigned int'>
producer_is_gxx_lt_4_6 = <Enter 24 to explore this field of type
'unsigned int'>

On Tue, Apr 10, 2012 at 10:16 AM, Doug Evans <dje@google.com> wrote:
> Hi.
> Thanks for persevering!
>
> LGTM
>
> I think all the doc issues are resolved, right Eli?
>
> On Mon, Apr 9, 2012 at 11:37 AM, Siva Chandra <sivachandra@google.com> wrote:
>> <ping>
>>
>> Is there sufficient interest in this?
>>
>> On Mon, Apr 2, 2012 at 11:28 AM, Siva Chandra <sivachandra@google.com> wrote:
>>> Thanks Eli, I have fixed it. The complete patch is attached.
>>>
>>> Code ChangeLog:
>>>
>>> 2012-04-02  Siva Chandra Reddy  <sivachandra@google.com>
>>>
>>>        New command 'explore' which helps explore values and types in
>>>        scope.
>>>        * NEWS: Add an entry about the new 'explore' command.
>>>        * data-directory/Makefile.in: Add gdb/command/explore.py
>>>        * python/lib/gdb/command/explore.py: Implemention of the 'explore'
>>>        command using the GDB Python API.
>>>
>>> Docs ChangeLog:
>>>
>>> 2012-04-02  Siva Chandra Reddy  <sivachandra@google.com>
>>>
>>>        * gdb.texinfo (Examining Data): Document the 'explore' command.
>>>
>>> Testsuite ChangeLog:
>>>
>>> 2012-04-02  Siva Chandra Reddy  <sivachandra@google.com>
>>>
>>>        * gdb.python/Makefile.in: Add py-explore to EXECUTABLES.
>>>        * gdb.python/py-explore.c: C program used for testing the new
>>>        'explore' command on C constructs.
>>>        * gdb.python/py-explore.cc: C++ program used for testing the new
>>>        'explore' command on C++ constructs.
>>>        * gdb-python/py-explore.exp: Tests for the new 'explore'
>>>        command on C constructs.
>>>        * gdb-python/py-explore-cc.exp: Tests for the new 'explore'
>>>        command on C++ constructs.
>>>
>>> Thanks,
>>> Siva Chandra