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 rschooler at tilera dot com  2009-01-19 18:40 -------
Subject: RE:  MI -data-evaluate-expression prints optimized-out variable value as 0x0

Yes and no.  Your source base seems to have changed from the 6.8 we
started with.  My diff is:

==== //tilera/main/tools/gnu/gdb/mi/mi-main.c#3 -
/u/rschooler/p4/tools/gnu/gdb/mi/mi-main.c ====
@@ -670,9 +670,7 @@
   val = evaluate_expression (expr);
 
   /* Print the result of the expression evaluation.  */
-  val_print (value_type (val), value_contents (val),
-	     value_embedded_offset (val), VALUE_ADDRESS (val),
-	     stb->stream, 0, 0, 0, 0);
+  common_val_print (val, stb->stream, 0, 0, 0, 0);
 
   ui_out_field_stream (uiout, "value", stb);
   ui_out_stream_delete (stb);

This worked for me.  Should I go with this change now, or wait for some
more official patch, with regression testing, etc.?

Thanks,	-- Richard

Richard Schooler
VP Software Engineering
Tilera Corp.
1900 West Park Drive, Westborough MA 01581
Tel.: +1 (508) 616 9300 x236
Cell: +1 (617) 233 8425
 

> -----Original Message-----
> From: nickrob at snap dot net dot nz [mailto:sourceware-
> bugzilla@sourceware.org]
> Sent: Friday, January 16, 2009 5:18 PM
> To: Richard Schooler
> Subject: [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 reported the bug, or are watching the reporter.


-- 


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]