Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH:gdb/mi] Update a specified list of variable objects
@ 2009-09-21 12:09 Nick Roberts
  2009-09-21 12:39 ` Vladimir Prus
  2009-09-21 16:58 ` Tom Tromey
  0 siblings, 2 replies; 8+ messages in thread
From: Nick Roberts @ 2009-09-21 12:09 UTC (permalink / raw)
  To: gdb-patches

Since -var-list-children currently creates variable objects of all children
and this may be a large number, I would like to be able to restrict
-var-update to just update those variable objects whose expressions are
visible in the front end.  This could be done by updating them individually
but that might result in many round trips.  I would therefore like to commit
the following patch which allows a list of variable objects to be specified in
the argument to -var-update:

          -var-update [PRINT_VALUES] NAME1 NAME2 ...

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


2009-09-22  Nick Roberts  <nickrob@snap.net.nz>

	* mi/mi-cmd-var.c (mi_cmd_var_update): Accept a list of
	variable objects to update.


*** mi-cmd-var.c.~1.61.~	2009-09-16 18:30:24.000000000 +1200
--- mi-cmd-var.c	2009-09-17 14:54:15.000000000 +1200
*************** mi_cmd_var_update (char *command, char *
*** 660,678 ****
    struct cleanup *cleanup;
    char *name;
    enum print_values print_values;
  
!   if (argc != 1 && argc != 2)
!     error (_("mi_cmd_var_update: Usage: [PRINT_VALUES] NAME."));
  
!   if (argc == 1)
!     name = argv[0];
!   else
!     name = (argv[1]);
  
!   if (argc == 2)
!     print_values = mi_parse_values_option (argv[0]);
!   else
!     print_values = PRINT_NO_VALUES;
  
    if (mi_version (uiout) <= 1)
      cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
--- 660,705 ----
    struct cleanup *cleanup;
    char *name;
    enum print_values print_values;
+   int optind = 0;
+   char *optarg;
  
!   enum opt
!     {
!       NO_VALUES, SIMPLE_VALUES, ALL_VALUES
!     };
  
!   static struct mi_opt opts[] =
!   {
!       { "-no-values", NO_VALUES, 0 },
!       { "-simple-values", SIMPLE_VALUES, 0 },
!       { "-all-values", ALL_VALUES, 0 },
!       { 0, 0, 0 }
!     };
  
!   while (1)
!     {
!       int opt = mi_getopt ("mi_cmd_var_update",
! 			   argc, argv, opts, &optind, &optarg);
!       if (opt < 0)
! 	break;
!       switch ((enum opt) opt)
! 	{
! 	case NO_VALUES:
! 	  print_values = PRINT_NO_VALUES;
! 	  break;
! 	case SIMPLE_VALUES:
! 	  print_values = PRINT_SIMPLE_VALUES;
! 	  break;
! 	case ALL_VALUES:
! 	  print_values = PRINT_ALL_VALUES;
! 	  break;
! 	}
!     }
! 
!   if (optind >= argc)
!     error (_("mi_cmd_var_update: Usage: [PRINT_VALUES] NAME1 NAME2 ..."));
! 
!   name = argv[optind];
  
    if (mi_version (uiout) <= 1)
      cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
*************** mi_cmd_var_update (char *command, char *
*** 697,706 ****
      }
    else
      {
!       /* Get varobj handle, if a valid var obj name was specified */
!       struct varobj *var = varobj_get_handle (name);
! 
!       varobj_update_one (var, print_values, 1 /* explicit */);
      }
  
    do_cleanups (cleanup);
--- 724,737 ----
      }
    else
      {
!       int index = optind;
!       while (argv[index]) {
! 	/* Get varobj handle, if a valid var obj name was specified */
! 	struct varobj *var = varobj_get_handle (argv[index]);
! 
! 	varobj_update_one (var, print_values, 1 /* explicit */);
! 	index++;
!       }
      }
  
    do_cleanups (cleanup);


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

end of thread, other threads:[~2009-09-29 23:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 12:09 [PATCH:gdb/mi] Update a specified list of variable objects Nick Roberts
2009-09-21 12:39 ` Vladimir Prus
2009-09-21 23:39   ` Nick Roberts
2009-09-22  0:04     ` Nick Roberts
2009-09-28 16:33       ` Vladimir Prus
2009-09-29 23:36         ` Nick Roberts
2009-09-21 16:58 ` Tom Tromey
2009-09-21 23:39   ` Nick Roberts

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