This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MI: type prefixes for values [PATCH]
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Vladimir Prus <ghost at cs dot msu dot su>, gdb-patches at sources dot redhat dot com
- Date: Sat, 3 Feb 2007 18:31:02 +1300
- Subject: Re: MI: type prefixes for values [PATCH]
- References: <17427.54333.236860.258115@kahikatea.snap.net.nz> <dvemrm$al0$1@sea.gmane.org> <20060317191207.GA19068@nevyn.them.org> <dvliph$urc$1@sea.gmane.org> <20060324030332.GB2853@nevyn.them.org> <e00anu$f6m$1@sea.gmane.org> <20060324202056.GA26748@nevyn.them.org> <e12k8s$dci$1@sea.gmane.org> <e2scu2$vvn$1@sea.gmane.org> <20060505192535.GM31029@nevyn.them.org> <20060515165354.GG28924@nevyn.them.org>
On Mon, 15 May 2006 12:53:54 -0400 at Daniel Jacobowitz writes:
> > > This patch doesn't touch the issue of type prefixes, leaving that to
> > > deal with separately.
> >
> > If I'm reading this right, I have since realised that my patch to use
> > common_val_print was no good because it only prints address and not values
> > for things like references
>
> Vladimir noticed that there's a deref_ref argument to common_val_print;
> you passed zero, but if you pass one instead, it ought to do the right
> thing.
>
> Would you like to try the patch again with that change?
Here's a patch which got a bit lost in the mists of time. No regressions.
--
Nick http://www.inet.net.nz/~nickrob
2007-02-03 Nick Roberts <nickrob@snap.net.nz>
* mi/mi-cmd-stack.c (list_args_or_locals): Use common_val_print
instead of print_variable_value to print values.
*** mi-cmd-stack.c 10 Jan 2007 11:56:57 +1300 1.32
--- mi-cmd-stack.c 03 Feb 2007 18:25:42 +1300
*************** list_args_or_locals (int locals, int val
*** 275,281 ****
{
struct cleanup *cleanup_tuple = NULL;
struct symbol *sym2;
! if (values != PRINT_NO_VALUES)
cleanup_tuple =
make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", SYMBOL_PRINT_NAME (sym));
--- 275,282 ----
{
struct cleanup *cleanup_tuple = NULL;
struct symbol *sym2;
! struct value *val;
! if (values != PRINT_NO_VALUES)
cleanup_tuple =
make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", SYMBOL_PRINT_NAME (sym));
*************** list_args_or_locals (int locals, int val
*** 297,309 ****
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
{
! print_variable_value (sym2, fi, stb->stream);
ui_out_field_stream (uiout, "value", stb);
}
do_cleanups (cleanup_tuple);
break;
case PRINT_ALL_VALUES:
! print_variable_value (sym2, fi, stb->stream);
ui_out_field_stream (uiout, "value", stb);
do_cleanups (cleanup_tuple);
break;
--- 298,314 ----
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
{
! val = read_var_value (sym2, fi);
! common_val_print
! (val, stb->stream, 0, 1, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "value", stb);
}
do_cleanups (cleanup_tuple);
break;
case PRINT_ALL_VALUES:
! val = read_var_value (sym2, fi);
! common_val_print
! (val, stb->stream, 0, 1, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "value", stb);
do_cleanups (cleanup_tuple);
break;