Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch 0/2] New 'explore' command
@ 2012-03-07 11:28 Siva Chandra
  2012-03-07 16:24 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Siva Chandra @ 2012-03-07 11:28 UTC (permalink / raw)
  To: gdb-patches

Hi all,

I had, in a different thread, sent different patches for a new
'explore' command implemented in C as well as in Python using the GDB
Python API (see for ref
http://sourceware.org/ml/gdb-patches/2012-02/msg00099.html). There
were a couple of comments about preferring a Python implementation
over a C implementation. However, I have preferred a C implementation
for two reasons: 1. I want this to be available to all GDB builds and
not limited to those built with Python enabled, 2. I could not find a
way to get the 'target' type of a C++ reference value using the Python
API. I am probably missing something here.

Whatever the case, if the community prefers a Python implementation,
then so be it. I will be sending both implementations as different
patches (with docs) in this series. I apologize if this amounts to
being spam!

To help recollect, sample runs of the 'explore' command are as follows:

Example of value exploration:
========================
(gdb) explore cs
The value of 'cs' is of type 'struct ComplexStruct' with the following fields:
  s = <Enter 0 to explore this field of type 'struct SimpleStruct'>
  u = <Enter 1 to explore this field of type 'union SimpleUnion'>
 sa = <Enter 2 to explore this field of type 'SS [10]'>

Enter the field number of choice: 2
'cs.sa' is an array of elements of type 'SS'.
Enter the index you want to explore in 'cs.sa': 1
The value of '(cs.sa)[1]' is of type 'SS' which is a typedef of type
'struct SimpleStruct'.
The value of '(cs.sa)[1]' is of type 'struct SimpleStruct' with the
following fields:
 a = 1 .. (Value of type 'int')
 d = 11.1 .. (Value of type 'double')

Press enter to return to parent value:

Returning to parent value...

'cs.sa' is an array of elements of type 'SS'.
Enter the index you want to explore in 'cs.sa':
Returning to parent value...
The value of 'cs' is of type 'struct ComplexStruct' with the following fields:
  s = <Enter 0 to explore this field of type 'struct SimpleStruct'>
  u = <Enter 1 to explore this field of type 'union SimpleUnion'>
 sa = <Enter 2 to explore this field of type 'SS [10]'>

Enter the field number of choice:
(gdb)

Example of type exploration:
========================
(gdb) explore struct SimpleStruct
'struct SimpleStruct' has the following fields:
 a = <Enter 0 to explore this field of type 'int'>
 d = <Enter 1 to explore this field of type 'double'>

Enter the field number of choice: 1
field 'd' of 'struct SimpleStruct' is of a scalar type 'double'.
Press enter to return to enclosing type:

Returning to parent type...
'struct SimpleStruct' has the following fields:
 a = <Enter 0 to explore this field of type 'int'>
 d = <Enter 1 to explore this field of type 'double'>

Enter the field number of choice:
(gdb)

Thanks,
Siva Chandra


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 0/2] New 'explore' command
  2012-03-07 11:28 [patch 0/2] New 'explore' command Siva Chandra
@ 2012-03-07 16:24 ` Joel Brobecker
  2012-03-07 18:47   ` Siva Chandra
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2012-03-07 16:24 UTC (permalink / raw)
  To: Siva Chandra; +Cc: gdb-patches

Hi Siva,

FWIW, I agree with Doug that a Python version of the command would be
better suited...

-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 0/2] New 'explore' command
  2012-03-07 16:24 ` Joel Brobecker
@ 2012-03-07 18:47   ` Siva Chandra
  0 siblings, 0 replies; 3+ messages in thread
From: Siva Chandra @ 2012-03-07 18:47 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

OK. So it looks like we can ignore [patch 1/2] in this series then.

On Wed, Mar 7, 2012 at 9:54 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> Hi Siva,
>
> FWIW, I agree with Doug that a Python version of the command would be
> better suited...
>
> --
> Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-07 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 11:28 [patch 0/2] New 'explore' command Siva Chandra
2012-03-07 16:24 ` Joel Brobecker
2012-03-07 18:47   ` Siva Chandra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox