This is the mail archive of the gdb-prs@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]

[Bug mi/9752] MI -data-evaluate-expression prints optimized-out variable value as 0x0


------- Additional Comments From nickrob at snap dot net dot nz  2009-01-16 22:17 -------
Subject: Re:  New: MI -data-evaluate-expression prints optimized-out variable value as 0x0

 > Eclipse/CDT, when hovering over a variable in a source pane, will display
 > 0x0 as the value for optimized-out variables that don't show up in the
 > Variables pane.
 > 
 > This appears to be an underlying GDB problem with the MI interface it uses
 > to talk to external front ends.  Here's a transcript running ?gdb
 > -interpreter=mi?, and typing a mix of normal and MI commands at it:
 > 
 > (gdb) p ecs
 > 
 > &"p ecs\n"
 > 
 > ~"$1 = <value optimized out>\n"
 > 
 > ^done
 > 
 > (gdb) -data-evaluate-expression ecs
 > 
 > ^done,value="0x0"

Does this change DTRT?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


Index: mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.142
diff -p -u -p -r1.142 mi-main.c
--- mi-main.c	14 Jan 2009 15:21:55 -0000	1.142
+++ mi-main.c	16 Jan 2009 22:16:03 -0000
@@ -776,10 +776,7 @@ mi_cmd_data_evaluate_expression (char *c
   /* Print the result of the expression evaluation.  */
   get_user_print_options (&opts);
   opts.deref_ref = 0;
-  val_print (value_type (val), value_contents (val),
-	     value_embedded_offset (val), VALUE_ADDRESS (val),
-	     stb->stream, 0, &opts, current_language);
-
+  common_val_print (val, stb->stream, 0, &opts, current_language);
   ui_out_field_stream (uiout, "value", stb);
   ui_out_stream_delete (stb);


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9752

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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