MI: type prefixes for values [PATCH]

Nick Roberts nickrob@snap.net.nz
Sat Feb 3 05:31:00 GMT 2007


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;



More information about the Gdb-patches mailing list