Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Type information in -data-evaluate-expression
@ 2007-07-30 13:52 André Pönitz
  2007-07-30 15:34 ` Vladimir Prus
  0 siblings, 1 reply; 14+ messages in thread
From: André Pönitz @ 2007-07-30 13:52 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]


Hi all.

While playing around with gdb's "mi" interface (which looks rather
nice for scripting btw...) I came across a few places where I think
the interface might be made even more convienient without much
effort.

One example: As far as I can see currently the only way to obtain 
the type of an expression is to use -var-create & -var-delete.
It would be more convienient for me if I could get that information
with a single command without creating a variable which will be
thrown away immediatedly afterwards.

A possibility to do so would be to "enhance" "-data-evaluate-expression"
to return not only the value, but also the type information which is
is available after the evaluation process anyway.

I came up with a tiny patch that "seem to work for me". But as this
is the first time I look gdb source I am unsure whether this is done
properly or if some kind of cleanup is needed, and, of course, whether
there is a chance to get such patches included in gdb proper
at some point of time.

Andre'

[-- Attachment #2: t --]
[-- Type: text/x-diff, Size: 536 bytes --]

Index: mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.100
diff -u -r1.100 mi-main.c
--- mi-main.c	16 Jun 2007 17:16:26 -0000	1.100
+++ mi-main.c	30 Jul 2007 13:08:51 -0000
@@ -706,6 +706,11 @@
 	     stb->stream, 0, 0, 0, 0);
 
   ui_out_field_stream (uiout, "value", stb);
+
+  type_print (value_type (val), "", stb->stream, -1);
+
+  ui_out_field_stream (uiout, "type", stb);
+
   ui_out_stream_delete (stb);
 
   do_cleanups (old_chain);

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

end of thread, other threads:[~2007-07-31 11:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-30 13:52 Type information in -data-evaluate-expression André Pönitz
2007-07-30 15:34 ` Vladimir Prus
2007-07-30 17:06   ` André Pönitz
2007-07-30 23:17     ` Nick Roberts
     [not found]       ` <200707310922.14919.apoenitz@trolltech.com>
2007-07-31  9:13         ` Nick Roberts
2007-07-31  9:40           ` André Pönitz
2007-07-31 10:39             ` Nick Roberts
2007-07-31 11:02               ` Vladimir Prus
2007-07-31 11:25                 ` Nick Roberts
2007-07-31 11:06               ` Daniel Jacobowitz
2007-07-31 13:35                 ` Nick Roberts
2007-07-31 10:14           ` Vladimir Prus
2007-07-31 10:29             ` Nick Roberts
2007-07-31  8:09     ` Vladimir Prus

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