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

[PATCH] Make tracepoints into breakpoints


Here is the long-threatened patch that makes tracepoints into a type of breakpoint. Conceptually, the change is straightforward; we add a new breakpoint type bp_tracepoint, add three tracepoint-specific fields to struct breakpoint, special-case the breakpoint code here and there, and remove the old tracepoint manipulation code. In general, tracepoints look like regular breakpoints, except that they are only inserted by the tstart command, and the program never stops at any of them.

Some of the details are messy; for instance, one could argue that "delete trace" and "info trace" are still useful, as versions of breakpoint commands that filter out non-tracepoints, but it seems unduly pedantic to have "delete trace <num>" on a non-tracepoint be an error. So I retained old behavior for the no-argument case, and otherwise just forwarded into general breakpoint commands. Likewise, one could make a case that breakpoint commands and tracepoint actions should become the same field, but that will take more thought to get right, and makes more sense as a later change. So in the meantime I prefix the actions in "info break" with an 'A' to make clear that they are not breakpoint commands.

Another unresolved issue is locations. Tracepoints can now have multiple locations, but unlike breakpoint numbers, tracepoint numbers are part of the tracing protocol, and it's not clear whether "bp.loc"-style numbers should be added to the protocol, or a new numbering system introduced instead.

I tested this on native Linux and show no regressions, plus it all works well with a CodeSourcery customer's target that supports tracepoints. Insight also still works. Since this is rather a large patch, I'll give people a few days to kibitz before committing. Note that there are multiple new features in the pipeline exploiting breakpoint-ness of tracepoints, so there will be several chances to fix up minor problems.

Stan

2009-03-27 Stan Shebs <stan@codesourcery.com>

   Make tracepoints into a type of breakpoint.
   * breakpoint.h (enum bptype): Add bp_tracepoint.
   (struct breakpoint): Add fields step_count, pass_count, actions.
   (get_tracepoint, get_tracepoint_by_number): Declare.
   (all_tracepoints): Declare.
   * breakpoint.c: Include tracepoint.h, readline.h.
   (ALL_TRACEPOINTS): Move here from tracepoint.c.
   (tracepoint_count): Ditto.
   (should_be_inserted): GDB does not insert tracepoints itself.
   (print_it_typical): Add tracepoint case.
   (bpstat_what): Ditto.
   (print_one_breakpoint_location): Ditto, and add printing for
   pass count, step count, and action list.
   (user_settable_breakpoint): Add tracepoint case.
   (allocate_bp_location): Ditto.
   (set_breakpoint_location_function): Ditto.
   (disable_breakpoints_in_shlibs): Ditto.
   (mention): Ditto.
   (break_command_really): Add argument traceflag, use to choose
   basic breakpoint type.
   (break_command_1): Pass extra argument.
   (set_breakpoint, handle_gnu_v3_exceptions): Ditto.
   (breakpoint_re_set_one): Add tracepoint case.
   (disable_command, enable_command): Ditto.
   (set_tracepoint_count): Move here from tracepoint.c.
   (trace_command): Move here from tracepoint.c and use
   break_command_really.
   (tracepoints_info): Move here from tracepoint.c and call
   breakpoints_info.
   (enable_trace_command): Move here from tracepoint.c and call
   enable_command.
   (disable_trace_command): Move here from tracepoint.c and call
   disable_command.
   (delete_trace_command): Move here from tracepoint.c and call
   delete_breakpoint.
   (trace_pass_command): Move here from tracepoint.c.
   (get_tracepoint_by_number): Ditto.
   (tracepoint_save_command): Ditto.
   (get_tracepoint): New function.
   (all_tracepoints): New function.
   (_initialize_breakpoint): Move tracepoint init from tracepoint.c,
   deprecate "enable trace" and "disable trace" commands.
   * tracepoint.h (struct tracepoint): Remove.
   (tracepoint_chain): Remove decl.
   (deprecated_create_tracepoint_hook): Remove decl.
   (deprecated_delete_tracepoint_hook): Remove decl.
   (deprecated_modify_tracepoint_hook): Remove decl.
   (ALL_TRACEPOINTS, ALL_TRACEPOINTS_SAFE): Remove.
   (free_actions): Update signature.
   (validate_actionline): Update signature.
   * tracepoint.c: Include breakpoint.h.
   (tracepoint_chain, tracepoint_count): Remove.
   (free_actions, make_cleanup_free_actions): Update signature.
   (trace_command, set_raw_tracepoint): Remove.
   (trace_mention): Remove.
   (tracepoints_info): Remove.
   (tracepoint_operation, map_args_over_tracepoints): Remove.
   (get_tracepoint_by_number): Remove.
   (enable_trace_command, disable_trace_command): Remove.
   (delete_trace_command, trace_pass_command): Remove.
   (trace_actions_command, read_actions): Update signature.
   (validate_actionline): Update signature, use bp loc.
   (encode_actions): Ditto.
   (download_tracepoint): New function, body of trace_start_command.
   (trace_start_command): Call it, use all_tracepoints.
   (tracepoint_save_command): Remove.
   (tracepoint_dump_command): Use get_tracepoint.
   (_initialize_tracepoint): Move command definitions to breakpoint.c.

   doc/
   * gdb.texinfo (Tracepoints): Describe tracepoints as a
   special case of breakpoints.
   (Enable and Disable Tracepoints): Mention deprecation.
   (Listing Tracepoints): Update description and example.

   testsuite/
   * gdb.trace/actions.exp: Update to match new info trace format.
   * gdb.trace/deltrace.exp: Ditto.
   * gdb.trace/infotrace.exp: Ditto.
   * gdb.trace/passcount.exp: Ditto.
   * gdb.trace/save-trace.exp: Ditto.
   * gdb.trace/while-stepping.exp: Ditto.
   * gdb.trace/tracecmd.exp: Ditto, plus don't allow pending option.

   gdbtk/
   * generic/gdbtk-bp.c (gdb_actions_command): Update to handle
   tracepoints as breakpoints.
   (gdb_get_tracepoint_info): Ditto, plus use get_tracepoint and
   breakpoint locations.
   (tracepoint_exists): Ditto, plus use all_tracepoints.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.388
diff -p -r1.388 breakpoint.c
*** breakpoint.c	26 Mar 2009 23:30:10 -0000	1.388
--- breakpoint.c	27 Mar 2009 19:10:49 -0000
***************
*** 25,30 ****
--- 25,31 ----
  #include "symtab.h"
  #include "frame.h"
  #include "breakpoint.h"
+ #include "tracepoint.h"
  #include "gdbtypes.h"
  #include "expression.h"
  #include "gdbcore.h"
***************
*** 58,63 ****
--- 59,71 ----
  #include "wrapper.h"
  #include "valprint.h"
  
+ /* readline include files */
+ #include "readline/readline.h"
+ #include "readline/history.h"
+ 
+ /* readline defines this.  */
+ #undef savestring
+ 
  #include "mi/mi-common.h"
  
  /* Arguments to pass as context to some catch command handlers.  */
*************** static int is_hardware_watchpoint (struc
*** 191,196 ****
--- 199,214 ----
  
  static void insert_breakpoint_locations (void);
  
+ static void tracepoints_info (char *, int);
+ 
+ static void delete_trace_command (char *, int);
+ 
+ static void enable_trace_command (char *, int);
+ 
+ static void disable_trace_command (char *, int);
+ 
+ static void trace_pass_command (char *, int);
+ 
  /* Flag indicating that a command has proceeded the inferior past the
     current breakpoint.  */
  
*************** static int overlay_events_enabled;
*** 314,319 ****
--- 332,343 ----
  	     B ? (TMP=B->global_next, 1): 0;	\
  	     B = TMP)
  
+ /* Iterator for tracepoints only.  */
+ 
+ #define ALL_TRACEPOINTS(B)  \
+   for (B = breakpoint_chain; B; B = B->next)  \
+     if ((B)->type == bp_tracepoint)
+ 
  /* Chains of all breakpoints defined.  */
  
  struct breakpoint *breakpoint_chain;
*************** VEC(bp_location_p) *moribund_locations =
*** 329,334 ****
--- 353,362 ----
  
  int breakpoint_count;
  
+ /* Number of last tracepoint made.  */
+ 
+ int tracepoint_count;
+ 
  /* Return whether a breakpoint is an active enabled breakpoint.  */
  static int
  breakpoint_enabled (struct breakpoint *b)
*************** should_be_inserted (struct bp_location *
*** 1029,1034 ****
--- 1057,1067 ----
    if (!bpt->enabled || bpt->shlib_disabled || bpt->duplicate)
      return 0;
  
+   /* Tracepoints are inserted by the target at a time of its choosing,
+      not by us.  */
+   if (bpt->owner->type == bp_tracepoint)
+     return 0;
+ 
    return 1;
  }
  
*************** print_it_typical (bpstat bs)
*** 2423,2428 ****
--- 2456,2462 ----
      case bp_step_resume:
      case bp_watchpoint_scope:
      case bp_call_dummy:
+     case bp_tracepoint:
      default:
        result = PRINT_UNKNOWN;
        break;
*************** bpstat_what (bpstat bs)
*** 3324,3329 ****
--- 3358,3367 ----
  	  bs_class = bp_silent;
  	  retval.call_dummy = 1;
  	  break;
+ 
+ 	case bp_tracepoint:
+ 	  /* (should never occur, complain about it) */
+ 	  continue;
  	}
        current_action = table[(int) bs_class][(int) current_action];
      }
*************** print_one_breakpoint_location (struct br
*** 3423,3428 ****
--- 3461,3467 ----
      {bp_thread_event, "thread events"},
      {bp_overlay_event, "overlay events"},
      {bp_catchpoint, "catchpoint"},
+     {bp_tracepoint, "tracepoint"},
    };
    
    static char bpenables[] = "nynny";
*************** print_one_breakpoint_location (struct br
*** 3549,3554 ****
--- 3588,3594 ----
        case bp_shlib_event:
        case bp_thread_event:
        case bp_overlay_event:
+       case bp_tracepoint:
  	if (opts.addressprint)
  	  {
  	    annotate_field (4);
*************** print_one_breakpoint_location (struct br
*** 3593,3599 ****
           because the condition is an internal implementation detail
           that we do not want to expose to the user.  */
        annotate_field (7);
!       ui_out_text (uiout, "\tstop only if ");
        ui_out_field_string (uiout, "cond", b->cond_string);
        ui_out_text (uiout, "\n");
      }
--- 3633,3642 ----
           because the condition is an internal implementation detail
           that we do not want to expose to the user.  */
        annotate_field (7);
!       if (b->type == bp_tracepoint)
! 	ui_out_text (uiout, "\ttrace only if ");
!       else
! 	ui_out_text (uiout, "\tstop only if ");
        ui_out_field_string (uiout, "cond", b->cond_string);
        ui_out_text (uiout, "\n");
      }
*************** print_one_breakpoint_location (struct br
*** 3645,3650 ****
--- 3688,3721 ----
        do_cleanups (script_chain);
      }
  
+   if (!part_of_multiple && b->pass_count)
+     {
+       annotate_field (10);
+       ui_out_text (uiout, "\tpass count ");
+       ui_out_field_int (uiout, "pass", b->pass_count);
+       ui_out_text (uiout, " \n");
+     }
+ 
+   if (!part_of_multiple && b->step_count)
+     {
+       annotate_field (11);
+       ui_out_text (uiout, "\tstep count ");
+       ui_out_field_int (uiout, "step", b->step_count);
+       ui_out_text (uiout, " \n");
+     }
+ 
+   if (!part_of_multiple && b->actions)
+     {
+       struct action_line *action;
+       annotate_field (12);
+       for (action = b->actions; action; action = action->next)
+ 	{
+ 	  ui_out_text (uiout, "      A\t");
+ 	  ui_out_text (uiout, action->action);
+ 	  ui_out_text (uiout, "\n");
+ 	}
+     }
+ 
    if (ui_out_is_mi_like_p (uiout) && !part_of_multiple)
      {
        if (b->addr_string)
*************** user_settable_breakpoint (const struct b
*** 3735,3740 ****
--- 3806,3812 ----
    return (b->type == bp_breakpoint
  	  || b->type == bp_catchpoint
  	  || b->type == bp_hardware_breakpoint
+ 	  || b->type == bp_tracepoint
  	  || b->type == bp_watchpoint
  	  || b->type == bp_read_watchpoint
  	  || b->type == bp_access_watchpoint
*************** allocate_bp_location (struct breakpoint 
*** 4113,4118 ****
--- 4185,4191 ----
    switch (bpt->type)
      {
      case bp_breakpoint:
+     case bp_tracepoint:
      case bp_until:
      case bp_finish:
      case bp_longjmp:
*************** static void
*** 4202,4208 ****
  set_breakpoint_location_function (struct bp_location *loc)
  {
    if (loc->owner->type == bp_breakpoint
!       || loc->owner->type == bp_hardware_breakpoint)
      {
        find_pc_partial_function (loc->address, &(loc->function_name), 
  				NULL, NULL);
--- 4275,4282 ----
  set_breakpoint_location_function (struct bp_location *loc)
  {
    if (loc->owner->type == bp_breakpoint
!       || loc->owner->type == bp_hardware_breakpoint
!       || loc->owner->type == bp_tracepoint)
      {
        find_pc_partial_function (loc->address, &(loc->function_name), 
  				NULL, NULL);
*************** disable_breakpoints_in_shlibs (void)
*** 4477,4483 ****
         becomes enabled, or the duplicate is removed, gdb will try to insert
         all breakpoints.  If we don't set shlib_disabled here, we'll try
         to insert those breakpoints and fail.  */
!     if (((b->type == bp_breakpoint) || (b->type == bp_hardware_breakpoint))
  	&& !loc->shlib_disabled
  #ifdef PC_SOLIB
  	&& PC_SOLIB (loc->address)
--- 4551,4559 ----
         becomes enabled, or the duplicate is removed, gdb will try to insert
         all breakpoints.  If we don't set shlib_disabled here, we'll try
         to insert those breakpoints and fail.  */
!     if (((b->type == bp_breakpoint)
! 	 || (b->type == bp_hardware_breakpoint)
! 	 || (b->type == bp_tracepoint))
  	&& !loc->shlib_disabled
  #ifdef PC_SOLIB
  	&& PC_SOLIB (loc->address)
*************** mention (struct breakpoint *b)
*** 5007,5012 ****
--- 5083,5098 ----
  	printf_filtered (_("Hardware assisted breakpoint %d"), b->number);
  	say_where = 1;
  	break;
+       case bp_tracepoint:
+ 	if (ui_out_is_mi_like_p (uiout))
+ 	  {
+ 	    say_where = 0;
+ 	    break;
+ 	  }
+ 	printf_filtered (_("Tracepoint"));
+ 	printf_filtered (_(" %d"), b->number);
+ 	say_where = 1;
+ 	break;
  
        case bp_until:
        case bp_finish:
*************** find_condition_and_thread (char *tok, CO
*** 5514,5520 ****
  static void
  break_command_really (char *arg, char *cond_string, int thread,
  		      int parse_condition_and_thread,
! 		      int tempflag, int hardwareflag, 
  		      int ignore_count,
  		      enum auto_boolean pending_break_support,
  		      struct breakpoint_ops *ops,
--- 5600,5606 ----
  static void
  break_command_really (char *arg, char *cond_string, int thread,
  		      int parse_condition_and_thread,
! 		      int tempflag, int hardwareflag, int traceflag,
  		      int ignore_count,
  		      enum auto_boolean pending_break_support,
  		      struct breakpoint_ops *ops,
*************** break_command_really (char *arg, char *c
*** 5534,5539 ****
--- 5620,5626 ----
    int i;
    int pending = 0;
    int not_found = 0;
+   enum bptype type_wanted;
  
    sals.sals = NULL;
    sals.nelts = 0;
*************** break_command_really (char *arg, char *c
*** 5622,5627 ****
--- 5709,5718 ----
    if (!pending)
      breakpoint_sals_to_pc (&sals, addr_start);
  
+   type_wanted = (traceflag
+ 		 ? bp_tracepoint
+ 		 : (hardwareflag ? bp_hardware_breakpoint : bp_breakpoint));
+ 
    /* Verify that condition can be parsed, before setting any
       breakpoints.  Allocate a separate condition expression for each
       breakpoint. */
*************** break_command_really (char *arg, char *c
*** 5648,5656 ****
                  make_cleanup (xfree, cond_string);
              }
          }
!       create_breakpoints (sals, addr_string, cond_string,
! 			  hardwareflag ? bp_hardware_breakpoint 
! 			  : bp_breakpoint,
  			  tempflag ? disp_del : disp_donttouch,
  			  thread, ignore_count, ops, from_tty, enabled);
      }
--- 5739,5745 ----
                  make_cleanup (xfree, cond_string);
              }
          }
!       create_breakpoints (sals, addr_string, cond_string, type_wanted,
  			  tempflag ? disp_del : disp_donttouch,
  			  thread, ignore_count, ops, from_tty, enabled);
      }
*************** break_command_really (char *arg, char *c
*** 5661,5669 ****
  
        make_cleanup (xfree, copy_arg);
  
!       b = set_raw_breakpoint_without_location (hardwareflag 
! 					       ? bp_hardware_breakpoint 
! 					       : bp_breakpoint);
        set_breakpoint_count (breakpoint_count + 1);
        b->number = breakpoint_count;
        b->thread = -1;
--- 5750,5756 ----
  
        make_cleanup (xfree, copy_arg);
  
!       b = set_raw_breakpoint_without_location (type_wanted);
        set_breakpoint_count (breakpoint_count + 1);
        b->number = breakpoint_count;
        b->thread = -1;
*************** break_command_1 (char *arg, int flag, in
*** 5704,5710 ****
  
    break_command_really (arg, 
  			NULL, 0, 1 /* parse arg */,
! 			tempflag, hardwareflag,
  			0 /* Ignore count */,
  			pending_break_support, 
  			NULL /* breakpoint_ops */,
--- 5791,5797 ----
  
    break_command_really (arg, 
  			NULL, 0, 1 /* parse arg */,
! 			tempflag, hardwareflag, 0 /* traceflag */,
  			0 /* Ignore count */,
  			pending_break_support, 
  			NULL /* breakpoint_ops */,
*************** set_breakpoint (char *address, char *con
*** 5721,5727 ****
  {
    break_command_really (address, condition, thread,
  			0 /* condition and thread are valid.  */,
! 			tempflag, hardwareflag,
  			ignore_count,
  			pending 
  			? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,
--- 5808,5814 ----
  {
    break_command_really (address, condition, thread,
  			0 /* condition and thread are valid.  */,
! 			tempflag, hardwareflag, 0 /* traceflag */,
  			ignore_count,
  			pending 
  			? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,
*************** handle_gnu_v3_exceptions (int tempflag, 
*** 6584,6590 ****
  
    break_command_really (trigger_func_name, cond_string, -1,
  			0 /* condition and thread are valid.  */,
! 			tempflag, 0,
  			0,
  			AUTO_BOOLEAN_TRUE /* pending */,
  			&gnu_v3_exception_catchpoint_ops, from_tty,
--- 6671,6677 ----
  
    break_command_really (trigger_func_name, cond_string, -1,
  			0 /* condition and thread are valid.  */,
! 			tempflag, 0, 0,
  			0,
  			AUTO_BOOLEAN_TRUE /* pending */,
  			&gnu_v3_exception_catchpoint_ops, from_tty,
*************** breakpoint_re_set_one (void *bint)
*** 7444,7449 ****
--- 7531,7537 ----
        return 0;
      case bp_breakpoint:
      case bp_hardware_breakpoint:
+     case bp_tracepoint:
        if (b->addr_string == NULL)
  	{
  	  /* Anything without a string can't be re-set. */
*************** disable_command (char *args, int from_tt
*** 7809,7814 ****
--- 7897,7903 ----
  		 bpt->number);
  	continue;
        case bp_breakpoint:
+       case bp_tracepoint:
        case bp_catchpoint:
        case bp_hardware_breakpoint:
        case bp_watchpoint:
*************** enable_command (char *args, int from_tty
*** 7901,7906 ****
--- 7990,7996 ----
  		 bpt->number);
  	continue;
        case bp_breakpoint:
+       case bp_tracepoint:
        case bp_catchpoint:
        case bp_hardware_breakpoint:
        case bp_watchpoint:
*************** single_step_breakpoint_inserted_here_p (
*** 8084,8089 ****
--- 8174,8499 ----
    return 0;
  }
  
+ /* Tracepoint-specific operations.  */
+ 
+ /* Set tracepoint count to NUM.  */
+ static void
+ set_tracepoint_count (int num)
+ {
+   tracepoint_count = num;
+   set_internalvar (lookup_internalvar ("tpnum"),
+ 		   value_from_longest (builtin_type_int32, (LONGEST) num));
+ }
+ 
+ void
+ trace_command (char *arg, int from_tty)
+ {
+   break_command_really (arg, 
+ 			NULL, 0, 1 /* parse arg */,
+ 			0 /* tempflag */, 0 /* hardwareflag */,
+ 			1 /* traceflag */,
+ 			0 /* Ignore count */,
+ 			pending_break_support, 
+ 			NULL,
+ 			from_tty,
+ 			1 /* enabled */);
+   set_tracepoint_count (breakpoint_count);
+ }
+ 
+ /* Print information on tracepoint number TPNUM_EXP, or all if
+    omitted.  */
+ 
+ static void
+ tracepoints_info (char *tpnum_exp, int from_tty)
+ {
+   struct breakpoint *b;
+   int tps_to_list = 0;
+ 
+   /* In the no-arguments case, say "No tracepoints" if none found.  */
+   if (tpnum_exp == 0)
+     {
+       ALL_TRACEPOINTS (b)
+       {
+ 	if (b->number >= 0)
+ 	  {
+ 	    tps_to_list = 1;
+ 	    break;
+ 	  }
+       }
+       if (!tps_to_list)
+ 	{
+ 	  ui_out_message (uiout, 0, "No tracepoints.\n");
+ 	  return;
+ 	}
+     }
+ 
+   /* Otherwise be the same as "info break".  */
+   breakpoints_info (tpnum_exp, from_tty);
+ }
+ 
+ /* The 'enable trace' command enables tracepoints.  
+    Not supported by all targets.  */
+ static void
+ enable_trace_command (char *args, int from_tty)
+ {
+   enable_command (args, from_tty);
+ }
+ 
+ /* The 'disable trace' command disables tracepoints.  
+    Not supported by all targets.  */
+ static void
+ disable_trace_command (char *args, int from_tty)
+ {
+   disable_command (args, from_tty);
+ }
+ 
+ /* Remove a tracepoint (or all if no argument) */
+ static void
+ delete_trace_command (char *arg, int from_tty)
+ {
+   struct breakpoint *b, *temp;
+ 
+   dont_repeat ();
+ 
+   if (arg == 0)
+     {
+       int breaks_to_delete = 0;
+ 
+       /* Delete all breakpoints if no argument.
+          Do not delete internal or call-dummy breakpoints, these
+          have to be deleted with an explicit breakpoint number argument.  */
+       ALL_TRACEPOINTS (b)
+       {
+ 	if (b->number >= 0)
+ 	  {
+ 	    breaks_to_delete = 1;
+ 	    break;
+ 	  }
+       }
+ 
+       /* Ask user only if there are some breakpoints to delete.  */
+       if (!from_tty
+ 	  || (breaks_to_delete && query (_("Delete all tracepoints? "))))
+ 	{
+ 	  ALL_BREAKPOINTS_SAFE (b, temp)
+ 	  {
+ 	    if (b->type == bp_tracepoint &&
+ 		b->number >= 0)
+ 	      delete_breakpoint (b);
+ 	  }
+ 	}
+     }
+   else
+     map_breakpoint_numbers (arg, delete_breakpoint);
+ }
+ 
+ /* Set passcount for tracepoint.
+ 
+    First command argument is passcount, second is tracepoint number.
+    If tracepoint number omitted, apply to most recently defined.
+    Also accepts special argument "all".  */
+ 
+ static void
+ trace_pass_command (char *args, int from_tty)
+ {
+   struct breakpoint *t1 = (struct breakpoint *) -1, *t2;
+   unsigned int count;
+   int all = 0;
+ 
+   if (args == 0 || *args == 0)
+     error (_("passcount command requires an argument (count + optional TP num)"));
+ 
+   count = strtoul (args, &args, 10);	/* Count comes first, then TP num. */
+ 
+   while (*args && isspace ((int) *args))
+     args++;
+ 
+   if (*args && strncasecmp (args, "all", 3) == 0)
+     {
+       args += 3;			/* Skip special argument "all".  */
+       all = 1;
+       if (*args)
+ 	error (_("Junk at end of arguments."));
+     }
+   else
+     t1 = get_tracepoint_by_number (&args, 1, 1);
+ 
+   do
+     {
+       if (t1)
+ 	{
+ 	  ALL_TRACEPOINTS (t2)
+ 	    if (t1 == (struct breakpoint *) -1 || t1 == t2)
+ 	      {
+ 		t2->pass_count = count;
+ 		observer_notify_tracepoint_modified (t2->number);
+ 		if (from_tty)
+ 		  printf_filtered ("Setting tracepoint %d's passcount to %d\n",
+ 				   t2->number, count);
+ 	      }
+ 	  if (! all && *args)
+ 	    t1 = get_tracepoint_by_number (&args, 1, 0);
+ 	}
+     }
+   while (*args);
+ }
+ 
+ struct breakpoint *
+ get_tracepoint (int num)
+ {
+   struct breakpoint *t;
+ 
+   ALL_TRACEPOINTS (t)
+     if (t->number == num)
+       return t;
+ 
+   return NULL;
+ }
+ 
+ /* Utility: parse a tracepoint number and look it up in the list.
+    If MULTI_P is true, there might be a range of tracepoints in ARG.
+    if OPTIONAL_P is true, then if the argument is missing, the most
+    recent tracepoint (tracepoint_count) is returned.  */
+ struct breakpoint *
+ get_tracepoint_by_number (char **arg, int multi_p, int optional_p)
+ {
+   extern int tracepoint_count;
+   struct breakpoint *t;
+   int tpnum;
+   char *instring = arg == NULL ? NULL : *arg;
+ 
+   if (arg == NULL || *arg == NULL || ! **arg)
+     {
+       if (optional_p)
+ 	tpnum = tracepoint_count;
+       else
+ 	error_no_arg (_("tracepoint number"));
+     }
+   else
+     tpnum = multi_p ? get_number_or_range (arg) : get_number (arg);
+ 
+   if (tpnum <= 0)
+     {
+       if (instring && *instring)
+ 	printf_filtered ("bad tracepoint number at or near '%s'\n", 
+ 			 instring);
+       else
+ 	printf_filtered ("Tracepoint argument missing and no previous tracepoint\n");
+       return NULL;
+     }
+ 
+   ALL_TRACEPOINTS (t)
+     if (t->number == tpnum)
+     {
+       return t;
+     }
+ 
+   /* FIXME: if we are in the middle of a range we don't want to give
+      a message.  The current interface to get_number_or_range doesn't
+      allow us to discover this.  */
+   printf_unfiltered ("No tracepoint number %d.\n", tpnum);
+   return NULL;
+ }
+ 
+ /* save-tracepoints command */
+ static void
+ tracepoint_save_command (char *args, int from_tty)
+ {
+   struct breakpoint *tp;
+   int any_tp = 0;
+   struct action_line *line;
+   FILE *fp;
+   char *i1 = "    ", *i2 = "      ";
+   char *indent, *actionline, *pathname;
+   char tmp[40];
+   struct cleanup *cleanup;
+ 
+   if (args == 0 || *args == 0)
+     error (_("Argument required (file name in which to save tracepoints)"));
+ 
+   /* See if we have anything to save.  */
+   ALL_TRACEPOINTS (tp)
+   {
+     any_tp = 1;
+     break;
+   }
+   if (!any_tp)
+     {
+       warning (_("save-tracepoints: no tracepoints to save."));
+       return;
+     }
+ 
+   pathname = tilde_expand (args);
+   cleanup = make_cleanup (xfree, pathname);
+   if (!(fp = fopen (pathname, "w")))
+     error (_("Unable to open file '%s' for saving tracepoints (%s)"),
+ 	   args, safe_strerror (errno));
+   make_cleanup_fclose (fp);
+   
+   ALL_TRACEPOINTS (tp)
+   {
+     if (tp->addr_string)
+       fprintf (fp, "trace %s\n", tp->addr_string);
+     else
+       {
+ 	sprintf_vma (tmp, tp->loc->address);
+ 	fprintf (fp, "trace *0x%s\n", tmp);
+       }
+ 
+     if (tp->pass_count)
+       fprintf (fp, "  passcount %d\n", tp->pass_count);
+ 
+     if (tp->actions)
+       {
+ 	fprintf (fp, "  actions\n");
+ 	indent = i1;
+ 	for (line = tp->actions; line; line = line->next)
+ 	  {
+ 	    struct cmd_list_element *cmd;
+ 
+ 	    QUIT;		/* allow user to bail out with ^C */
+ 	    actionline = line->action;
+ 	    while (isspace ((int) *actionline))
+ 	      actionline++;
+ 
+ 	    fprintf (fp, "%s%s\n", indent, actionline);
+ 	    if (*actionline != '#')	/* skip for comment lines */
+ 	      {
+ 		cmd = lookup_cmd (&actionline, cmdlist, "", -1, 1);
+ 		if (cmd == 0)
+ 		  error (_("Bad action list item: %s"), actionline);
+ #if 0 /* names of commands not visible here, not clear if worth fixing */
+ 		if (cmd_cfunc_eq (cmd, while_stepping_pseudocommand))
+ 		  indent = i2;
+ 		else if (cmd_cfunc_eq (cmd, end_actions_pseudocommand))
+ 		  indent = i1;
+ #endif
+ 	      }
+ 	  }
+       }
+   }
+   do_cleanups (cleanup);
+   if (from_tty)
+     printf_filtered ("Tracepoints saved to file '%s'.\n", args);
+   return;
+ }
+ 
+ /* Create a vector of all tracepoints.  */
+ 
+ VEC(breakpoint_p) *
+ all_tracepoints ()
+ {
+   VEC(breakpoint_p) *tp_vec = 0;
+   struct breakpoint *tp;
+ 
+   ALL_TRACEPOINTS (tp)
+   {
+     VEC_safe_push (breakpoint_p, tp_vec, tp);
+   }
+ 
+   return tp_vec;
+ }
+ 
  
  /* This help string is used for the break, hbreak, tbreak and thbreak commands.
     It is defined as a macro to prevent duplication.
*************** _initialize_breakpoint (void)
*** 8146,8151 ****
--- 8556,8563 ----
       before a breakpoint is set.  */
    breakpoint_count = 0;
  
+   tracepoint_count = 0;
+ 
    add_com ("ignore", class_breakpoint, ignore_command, _("\
  Set ignore-count of breakpoint number N to COUNT.\n\
  Usage is `ignore N COUNT'."));
*************** hardware.)"),
*** 8475,8480 ****
--- 8887,8944 ----
  
    can_use_hw_watchpoints = 1;
  
+   /* Tracepoint manipulation commands.  */
+ 
+   c = add_com ("trace", class_breakpoint, trace_command, _("\
+ Set a tracepoint at specified line or function.\n\
+ \n"
+ BREAK_ARGS_HELP ("trace") "\n\
+ Do \"help tracepoints\" for info on other tracepoint commands."));
+   set_cmd_completer (c, location_completer);
+ 
+   add_com_alias ("tp", "trace", class_alias, 0);
+   add_com_alias ("tr", "trace", class_alias, 1);
+   add_com_alias ("tra", "trace", class_alias, 1);
+   add_com_alias ("trac", "trace", class_alias, 1);
+ 
+   add_info ("tracepoints", tracepoints_info, _("\
+ Status of tracepoints, or tracepoint number NUMBER.\n\
+ Convenience variable \"$tpnum\" contains the number of the\n\
+ last tracepoint set."));
+ 
+   add_info_alias ("tp", "tracepoints", 1);
+ 
+   add_cmd ("tracepoints", class_trace, delete_trace_command, _("\
+ Delete specified tracepoints.\n\
+ Arguments are tracepoint numbers, separated by spaces.\n\
+ No argument means delete all tracepoints."),
+ 	   &deletelist);
+ 
+   c = add_cmd ("tracepoints", class_trace, disable_trace_command, _("\
+ Disable specified tracepoints.\n\
+ Arguments are tracepoint numbers, separated by spaces.\n\
+ No argument means disable all tracepoints."),
+ 	   &disablelist);
+   deprecate_cmd (c, "disable");
+ 
+   c = add_cmd ("tracepoints", class_trace, enable_trace_command, _("\
+ Enable specified tracepoints.\n\
+ Arguments are tracepoint numbers, separated by spaces.\n\
+ No argument means enable all tracepoints."),
+ 	   &enablelist);
+   deprecate_cmd (c, "enable");
+ 
+   add_com ("passcount", class_trace, trace_pass_command, _("\
+ Set the passcount for a tracepoint.\n\
+ The trace will end when the tracepoint has been passed 'count' times.\n\
+ Usage: passcount COUNT TPNUM, where TPNUM may also be \"all\";\n\
+ if TPNUM is omitted, passcount refers to the last tracepoint defined."));
+ 
+   c = add_com ("save-tracepoints", class_trace, tracepoint_save_command, _("\
+ Save current tracepoint definitions as a script.\n\
+ Use the 'source' command in another debug session to restore them."));
+   set_cmd_completer (c, filename_completer);
+ 
    add_prefix_cmd ("breakpoint", class_maintenance, set_breakpoint_cmd, _("\
  Breakpoint specific settings\n\
  Configure various breakpoint-specific variables such as\n\
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.88
diff -p -r1.88 breakpoint.h
*** breakpoint.h	30 Jan 2009 18:28:00 -0000	1.88
--- breakpoint.h	27 Mar 2009 19:10:49 -0000
*************** enum bptype
*** 111,116 ****
--- 111,118 ----
      bp_overlay_event, 
  
      bp_catchpoint,
+ 
+     bp_tracepoint,
    };
  
  /* States of enablement of breakpoint. */
*************** struct breakpoint
*** 449,454 ****
--- 451,467 ----
         no location initially so had no context to parse
         the condition in.  */
      int condition_not_parsed;
+ 
+     /* Number of times this tracepoint should single-step 
+        and collect additional data.  */
+     long step_count;
+ 
+     /* Number of times this tracepoint should be hit before 
+        disabling/ending.  */
+     int pass_count;
+ 
+     /* Chain of action lines to execute when this tracepoint is hit.  */
+     struct action_line *actions;
    };
  
  typedef struct breakpoint *breakpoint_p;
*************** extern void breakpoint_retire_moribund (
*** 860,863 ****
--- 873,887 ----
  /* Tell a breakpoint to be quiet.  */
  extern void make_breakpoint_silent (struct breakpoint *);
  
+ /* Return a tracepoint with the given number if found.  */
+ extern struct breakpoint *get_tracepoint (int num);
+ 
+ /* Find a tracepoint by parsing a number in the supplied string.  */
+ extern struct breakpoint *get_tracepoint_by_number (char **arg, int multi_p,
+ 						    int optional_p);
+ 
+ /* Return a vector of all tracepoints currently defined.  The vector
+    is newly allocated; the caller should free when done with it.  */
+ extern VEC(breakpoint_p) *all_tracepoints (void);
+ 
  #endif /* !defined (BREAKPOINT_H) */
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.115
diff -p -r1.115 tracepoint.c
*** tracepoint.c	25 Feb 2009 02:14:23 -0000	1.115
--- tracepoint.c	27 Mar 2009 19:10:49 -0000
***************
*** 29,34 ****
--- 29,35 ----
  #include "language.h"
  #include "gdb_string.h"
  #include "inferior.h"
+ #include "breakpoint.h"
  #include "tracepoint.h"
  #include "remote.h"
  #include "linespec.h"
*************** extern void output_command (char *, int)
*** 102,113 ****
  
  /* ======= Important global variables: ======= */
  
- /* Chain of all tracepoints defined.  */
- struct tracepoint *tracepoint_chain;
- 
- /* Number of last tracepoint made.  */
- static int tracepoint_count;
- 
  /* Number of last traceframe collected.  */
  static int traceframe_number;
  
--- 103,108 ----
*************** static struct symtab_and_line traceframe
*** 124,135 ****
  static struct cmd_list_element *tfindlist;
  
  /* ======= Important command functions: ======= */
- static void trace_command (char *, int);
- static void tracepoints_info (char *, int);
- static void delete_trace_command (char *, int);
- static void enable_trace_command (char *, int);
- static void disable_trace_command (char *, int);
- static void trace_pass_command (char *, int);
  static void trace_actions_command (char *, int);
  static void trace_start_command (char *, int);
  static void trace_stop_command (char *, int);
--- 119,124 ----
*************** static void tracepoint_save_command (cha
*** 144,157 ****
  static void trace_dump_command (char *, int);
  
  /* support routines */
- static void trace_mention (struct tracepoint *);
  
  struct collection_list;
  static void add_aexpr (struct collection_list *, struct agent_expr *);
  static char *mem2hex (gdb_byte *, char *, int);
  static void add_register (struct collection_list *collection,
  			  unsigned int regno);
! static struct cleanup *make_cleanup_free_actions (struct tracepoint *t);
  static void free_actions_list (char **actions_list);
  static void free_actions_list_cleanup_wrapper (void *);
  
--- 133,145 ----
  static void trace_dump_command (char *, int);
  
  /* support routines */
  
  struct collection_list;
  static void add_aexpr (struct collection_list *, struct agent_expr *);
  static char *mem2hex (gdb_byte *, char *, int);
  static void add_register (struct collection_list *collection,
  			  unsigned int regno);
! static struct cleanup *make_cleanup_free_actions (struct breakpoint *t);
  static void free_actions_list (char **actions_list);
  static void free_actions_list_cleanup_wrapper (void *);
  
*************** remote_get_noisy_reply (char **buf_p,
*** 214,228 ****
    while (1);
  }
  
- /* Set tracepoint count to NUM.  */
- static void
- set_tracepoint_count (int num)
- {
-   tracepoint_count = num;
-   set_internalvar (lookup_internalvar ("tpnum"),
- 		   value_from_longest (builtin_type_int32, (LONGEST) num));
- }
- 
  /* Set traceframe number to NUM.  */
  static void
  set_traceframe_num (int num)
--- 202,207 ----
*************** set_traceframe_context (CORE_ADDR trace_
*** 323,758 ****
      }
  }
  
- /* Low level routine to set a tracepoint.
-    Returns the tracepoint object so caller can set other things.
-    Does not set the tracepoint number!
-    Does not print anything.
- 
-    ==> This routine should not be called if there is a chance of later
-    error(); otherwise it leaves a bogus tracepoint on the chain.
-    Validate your arguments BEFORE calling this routine!  */
- 
- static struct tracepoint *
- set_raw_tracepoint (struct symtab_and_line sal)
- {
-   struct tracepoint *t, *tc;
-   struct cleanup *old_chain;
- 
-   t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
-   old_chain = make_cleanup (xfree, t);
-   memset (t, 0, sizeof (*t));
-   t->address = sal.pc;
-   if (sal.symtab == NULL)
-     t->source_file = NULL;
-   else
-     t->source_file = savestring (sal.symtab->filename,
- 				 strlen (sal.symtab->filename));
- 
-   t->section = sal.section;
-   t->language = current_language->la_language;
-   t->input_radix = input_radix;
-   t->line_number = sal.line;
-   t->enabled_p = 1;
-   t->next = 0;
-   t->step_count = 0;
-   t->pass_count = 0;
-   t->addr_string = NULL;
- 
-   /* Add this tracepoint to the end of the chain
-      so that a list of tracepoints will come out in order
-      of increasing numbers.  */
- 
-   tc = tracepoint_chain;
-   if (tc == 0)
-     tracepoint_chain = t;
-   else
-     {
-       while (tc->next)
- 	tc = tc->next;
-       tc->next = t;
-     }
-   discard_cleanups (old_chain);
-   return t;
- }
- 
- /* Set a tracepoint according to ARG (function, linenum or *address).  */
- static void
- trace_command (char *arg, int from_tty)
- {
-   char **canonical = (char **) NULL;
-   struct symtabs_and_lines sals;
-   struct symtab_and_line sal;
-   struct tracepoint *t;
-   char *addr_start = 0, *addr_end = 0;
-   int i;
- 
-   if (!arg || !*arg)
-     error (_("trace command requires an argument"));
- 
-   if (from_tty && info_verbose)
-     printf_filtered ("TRACE %s\n", arg);
- 
-   addr_start = arg;
-   sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 
- 			0, &canonical, NULL);
-   addr_end = arg;
-   if (!sals.nelts)
-     return;	/* ??? Presumably decode_line_1 has already warned?  */
- 
-   /* Resolve all line numbers to PC's */
-   for (i = 0; i < sals.nelts; i++)
-     resolve_sal_pc (&sals.sals[i]);
- 
-   /* Now set all the tracepoints.  */
-   for (i = 0; i < sals.nelts; i++)
-     {
-       sal = sals.sals[i];
- 
-       t = set_raw_tracepoint (sal);
-       set_tracepoint_count (tracepoint_count + 1);
-       t->number = tracepoint_count;
- 
-       /* If a canonical line spec is needed use that instead of the
-          command string.  */
-       if (canonical != (char **) NULL && canonical[i] != NULL)
- 	t->addr_string = canonical[i];
-       else if (addr_start)
- 	t->addr_string = savestring (addr_start, addr_end - addr_start);
- 
-       trace_mention (t);
-     }
- 
-   if (sals.nelts > 1)
-     {
-       printf_filtered ("Multiple tracepoints were set.\n");
-       printf_filtered ("Use 'delete trace' to delete unwanted tracepoints.\n");
-     }
- }
- 
- /* Tell the user we have just set a tracepoint TP.  */
- 
- static void
- trace_mention (struct tracepoint *tp)
- {
-   struct value_print_options opts;
-   printf_filtered ("Tracepoint %d", tp->number);
- 
-   get_user_print_options (&opts);
-   if (opts.addressprint || (tp->source_file == NULL))
-     {
-       printf_filtered (" at ");
-       printf_filtered ("%s", paddress (tp->address));
-     }
-   if (tp->source_file)
-     printf_filtered (": file %s, line %d.",
- 		     tp->source_file, tp->line_number);
- 
-   printf_filtered ("\n");
- }
- 
- /* Print information on tracepoint number TPNUM_EXP, or all if
-    omitted.  */
- 
- static void
- tracepoints_info (char *tpnum_exp, int from_tty)
- {
-   struct tracepoint *t;
-   struct action_line *action;
-   int found_a_tracepoint = 0;
-   char wrap_indent[80];
-   struct symbol *sym;
-   int tpnum = -1;
- 
-   if (tpnum_exp)
-     tpnum = parse_and_eval_long (tpnum_exp);
- 
-   ALL_TRACEPOINTS (t)
-     if (tpnum == -1 || tpnum == t->number)
-     {
-       struct value_print_options opts;
-       get_user_print_options (&opts);
-       if (!found_a_tracepoint++)
- 	{
- 	  printf_filtered ("Num Enb ");
- 	  if (opts.addressprint)
- 	    {
- 	      if (gdbarch_addr_bit (current_gdbarch) <= 32)
- 		printf_filtered ("Address    ");
- 	      else
- 		printf_filtered ("Address            ");
- 	    }
- 	  printf_filtered ("PassC StepC What\n");
- 	}
-       strcpy (wrap_indent, "                           ");
-       if (opts.addressprint)
- 	{
- 	  if (gdbarch_addr_bit (current_gdbarch) <= 32)
- 	    strcat (wrap_indent, "           ");
- 	  else
- 	    strcat (wrap_indent, "                   ");
- 	}
- 
-       printf_filtered ("%-3d %-3s ", t->number,
- 		       t->enabled_p ? "y" : "n");
-       if (opts.addressprint)
- 	{
- 	  char *tmp;
- 
- 	  if (gdbarch_addr_bit (current_gdbarch) <= 32)
- 	    tmp = hex_string_custom (t->address & (CORE_ADDR) 0xffffffff, 
- 				     8);
- 	  else
- 	    tmp = hex_string_custom (t->address, 16);
- 
- 	  printf_filtered ("%s ", tmp);
- 	}
-       printf_filtered ("%-5d %-5ld ", t->pass_count, t->step_count);
- 
-       if (t->source_file)
- 	{
- 	  sym = find_pc_sect_function (t->address, t->section);
- 	  if (sym)
- 	    {
- 	      fputs_filtered ("in ", gdb_stdout);
- 	      fputs_filtered (SYMBOL_PRINT_NAME (sym), gdb_stdout);
- 	      wrap_here (wrap_indent);
- 	      fputs_filtered (" at ", gdb_stdout);
- 	    }
- 	  fputs_filtered (t->source_file, gdb_stdout);
- 	  printf_filtered (":%d", t->line_number);
- 	}
-       else
- 	print_address_symbolic (t->address, gdb_stdout, demangle, " ");
- 
-       printf_filtered ("\n");
-       if (t->actions)
- 	{
- 	  printf_filtered ("  Actions for tracepoint %d: \n", t->number);
- 	  for (action = t->actions; action; action = action->next)
- 	    {
- 	      printf_filtered ("\t%s\n", action->action);
- 	    }
- 	}
-     }
-   if (!found_a_tracepoint)
-     {
-       if (tpnum == -1)
- 	printf_filtered ("No tracepoints.\n");
-       else
- 	printf_filtered ("No tracepoint number %d.\n", tpnum);
-     }
- }
- 
- /* Optimization: the code to parse an enable, disable, or delete TP
-    command is virtually identical except for whether it performs an
-    enable, disable, or delete.  Therefore I've combined them into one
-    function with an opcode.  */
- enum tracepoint_opcode
- {
-   enable_op,
-   disable_op,
-   delete_op
- };
- 
- /* This function implements enable, disable and delete commands.  */
- static void
- tracepoint_operation (struct tracepoint *t, int from_tty,
- 		      enum tracepoint_opcode opcode)
- {
-   struct tracepoint *t2;
- 
-   if (t == NULL)	/* no tracepoint operand */
-     return;
- 
-   switch (opcode)
-     {
-     case enable_op:
-       t->enabled_p = 1;
-       observer_notify_tracepoint_modified (t->number);
-       break;
-     case disable_op:
-       t->enabled_p = 0;
-       observer_notify_tracepoint_modified (t->number);
-       break;
-     case delete_op:
-       if (tracepoint_chain == t)
- 	tracepoint_chain = t->next;
- 
-       ALL_TRACEPOINTS (t2)
- 	if (t2->next == t)
- 	{
- 	  t2->next = t->next;
- 	  break;
- 	}
- 
-       observer_notify_tracepoint_deleted (t->number);
- 
-       if (t->addr_string)
- 	xfree (t->addr_string);
-       if (t->source_file)
- 	xfree (t->source_file);
-       if (t->actions)
- 	free_actions (t);
- 
-       xfree (t);
-       break;
-     }
- }
- 
- /* Utility: parse a tracepoint number and look it up in the list.
-    If MULTI_P is true, there might be a range of tracepoints in ARG.
-    if OPTIONAL_P is true, then if the argument is missing, the most
-    recent tracepoint (tracepoint_count) is returned.  */
- struct tracepoint *
- get_tracepoint_by_number (char **arg, int multi_p, int optional_p)
- {
-   struct tracepoint *t;
-   int tpnum;
-   char *instring = arg == NULL ? NULL : *arg;
- 
-   if (arg == NULL || *arg == NULL || ! **arg)
-     {
-       if (optional_p)
- 	tpnum = tracepoint_count;
-       else
- 	error_no_arg (_("tracepoint number"));
-     }
-   else
-     tpnum = multi_p ? get_number_or_range (arg) : get_number (arg);
- 
-   if (tpnum <= 0)
-     {
-       if (instring && *instring)
- 	printf_filtered ("bad tracepoint number at or near '%s'\n", 
- 			 instring);
-       else
- 	printf_filtered ("Tracepoint argument missing and no previous tracepoint\n");
-       return NULL;
-     }
- 
-   ALL_TRACEPOINTS (t)
-     if (t->number == tpnum)
-     {
-       return t;
-     }
- 
-   /* FIXME: if we are in the middle of a range we don't want to give
-      a message.  The current interface to get_number_or_range doesn't
-      allow us to discover this.  */
-   printf_unfiltered ("No tracepoint number %d.\n", tpnum);
-   return NULL;
- }
- 
- /* Utility: 
-    parse a list of tracepoint numbers, and call a func for each.  */
- static void
- map_args_over_tracepoints (char *args, int from_tty,
- 			   enum tracepoint_opcode opcode)
- {
-   struct tracepoint *t, *tmp;
- 
-   if (args == 0 || *args == 0)	/* do them all */
-     ALL_TRACEPOINTS_SAFE (t, tmp)
-       tracepoint_operation (t, from_tty, opcode);
-   else
-     while (*args)
-       {
- 	QUIT;		/* Give user option to bail out with ^C.  */
- 	t = get_tracepoint_by_number (&args, 1, 0);
- 	tracepoint_operation (t, from_tty, opcode);
- 	while (*args == ' ' || *args == '\t')
- 	  args++;
-       }
- }
- 
- /* The 'enable trace' command enables tracepoints.  
-    Not supported by all targets.  */
- static void
- enable_trace_command (char *args, int from_tty)
- {
-   dont_repeat ();
-   map_args_over_tracepoints (args, from_tty, enable_op);
- }
- 
- /* The 'disable trace' command disables tracepoints.  
-    Not supported by all targets.  */
- static void
- disable_trace_command (char *args, int from_tty)
- {
-   dont_repeat ();
-   map_args_over_tracepoints (args, from_tty, disable_op);
- }
- 
- /* Remove a tracepoint (or all if no argument) */
- static void
- delete_trace_command (char *args, int from_tty)
- {
-   dont_repeat ();
-   if (!args || !*args)		/* No args implies all tracepoints; */
-     if (from_tty)		/* confirm only if from_tty...  */
-       if (tracepoint_chain)	/* and if there are tracepoints to
- 				   delete!  */
- 	if (!query (_("Delete all tracepoints? ")))
- 	  return;
- 
-   map_args_over_tracepoints (args, from_tty, delete_op);
- }
- 
- /* Set passcount for tracepoint.
- 
-    First command argument is passcount, second is tracepoint number.
-    If tracepoint number omitted, apply to most recently defined.
-    Also accepts special argument "all".  */
- 
- static void
- trace_pass_command (char *args, int from_tty)
- {
-   struct tracepoint *t1 = (struct tracepoint *) -1, *t2;
-   unsigned int count;
-   int all = 0;
- 
-   if (args == 0 || *args == 0)
-     error (_("passcount command requires an argument (count + optional TP num)"));
- 
-   count = strtoul (args, &args, 10);	/* Count comes first, then TP num. */
- 
-   while (*args && isspace ((int) *args))
-     args++;
- 
-   if (*args && strncasecmp (args, "all", 3) == 0)
-     {
-       args += 3;			/* Skip special argument "all".  */
-       all = 1;
-       if (*args)
- 	error (_("Junk at end of arguments."));
-     }
-   else
-     t1 = get_tracepoint_by_number (&args, 1, 1);
- 
-   do
-     {
-       if (t1)
- 	{
- 	  ALL_TRACEPOINTS (t2)
- 	    if (t1 == (struct tracepoint *) -1 || t1 == t2)
- 	      {
- 		t2->pass_count = count;
- 		observer_notify_tracepoint_modified (t2->number);
- 		if (from_tty)
- 		  printf_filtered ("Setting tracepoint %d's passcount to %d\n",
- 				   t2->number, count);
- 	      }
- 	  if (! all && *args)
- 	    t1 = get_tracepoint_by_number (&args, 1, 0);
- 	}
-     }
-   while (*args);
- }
- 
  /* ACTIONS functions: */
  
  /* Prototypes for action-parsing utility commands  */
! static void read_actions (struct tracepoint *);
  
  /* The three functions:
     collect_pseudocommand, 
--- 302,311 ----
      }
  }
  
  /* ACTIONS functions: */
  
  /* Prototypes for action-parsing utility commands  */
! static void read_actions (struct breakpoint *);
  
  /* The three functions:
     collect_pseudocommand, 
*************** collect_pseudocommand (char *args, int f
*** 785,791 ****
  static void
  trace_actions_command (char *args, int from_tty)
  {
!   struct tracepoint *t;
    char tmpbuf[128];
    char *end_msg = "End with a line saying just \"end\".";
  
--- 338,344 ----
  static void
  trace_actions_command (char *args, int from_tty)
  {
!   struct breakpoint *t;
    char tmpbuf[128];
    char *end_msg = "End with a line saying just \"end\".";
  
*************** trace_actions_command (char *args, int f
*** 816,822 ****
  
  /* worker function */
  static void
! read_actions (struct tracepoint *t)
  {
    char *line;
    char *prompt1 = "> ", *prompt2 = "  > ";
--- 369,375 ----
  
  /* worker function */
  static void
! read_actions (struct breakpoint *t)
  {
    char *line;
    char *prompt1 = "> ", *prompt2 = "  > ";
*************** read_actions (struct tracepoint *t)
*** 920,926 ****
  
  /* worker function */
  enum actionline_type
! validate_actionline (char **line, struct tracepoint *t)
  {
    struct cmd_list_element *c;
    struct expression *exp = NULL;
--- 473,479 ----
  
  /* worker function */
  enum actionline_type
! validate_actionline (char **line, struct breakpoint *t)
  {
    struct cmd_list_element *c;
    struct expression *exp = NULL;
*************** validate_actionline (char **line, struct
*** 971,977 ****
  		}
  	      /* else fall thru, treat p as an expression and parse it!  */
  	    }
! 	  exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
  	  old_chain = make_cleanup (free_current_contents, &exp);
  
  	  if (exp->elts[0].opcode == OP_VAR_VALUE)
--- 524,530 ----
  		}
  	      /* else fall thru, treat p as an expression and parse it!  */
  	    }
! 	  exp = parse_exp_1 (&p, block_for_pc (t->loc->address), 1);
  	  old_chain = make_cleanup (free_current_contents, &exp);
  
  	  if (exp->elts[0].opcode == OP_VAR_VALUE)
*************** validate_actionline (char **line, struct
*** 994,1000 ****
  	  /* We have something to collect, make sure that the expr to
  	     bytecode translator can handle it and that it's not too
  	     long.  */
! 	  aexpr = gen_trace_for_expr (t->address, exp);
  	  make_cleanup_free_agent_expr (aexpr);
  
  	  if (aexpr->len > MAX_AGENT_EXPR_LEN)
--- 547,553 ----
  	  /* We have something to collect, make sure that the expr to
  	     bytecode translator can handle it and that it's not too
  	     long.  */
! 	  aexpr = gen_trace_for_expr (t->loc->address, exp);
  	  make_cleanup_free_agent_expr (aexpr);
  
  	  if (aexpr->len > MAX_AGENT_EXPR_LEN)
*************** validate_actionline (char **line, struct
*** 1044,1050 ****
  
  /* worker function */
  void
! free_actions (struct tracepoint *t)
  {
    struct action_line *line, *next;
  
--- 597,603 ----
  
  /* worker function */
  void
! free_actions (struct breakpoint *t)
  {
    struct action_line *line, *next;
  
*************** do_free_actions_cleanup (void *t)
*** 1065,1071 ****
  }
  
  static struct cleanup *
! make_cleanup_free_actions (struct tracepoint *t)
  {
    return make_cleanup (do_free_actions_cleanup, t);
  }
--- 618,624 ----
  }
  
  static struct cleanup *
! make_cleanup_free_actions (struct breakpoint *t)
  {
    return make_cleanup (do_free_actions_cleanup, t);
  }
*************** free_actions_list (char **actions_list)
*** 1483,1489 ****
  
  /* Render all actions into gdb protocol.  */
  static void
! encode_actions (struct tracepoint *t, char ***tdp_actions,
  		char ***stepping_actions)
  {
    static char tdp_buff[2048], step_buff[2048];
--- 1036,1042 ----
  
  /* Render all actions into gdb protocol.  */
  static void
! encode_actions (struct breakpoint *t, char ***tdp_actions,
  		char ***stepping_actions)
  {
    static char tdp_buff[2048], step_buff[2048];
*************** encode_actions (struct tracepoint *t, ch
*** 1507,1513 ****
    *stepping_actions = NULL;
  
    gdbarch_virtual_frame_pointer (current_gdbarch, 
! 				 t->address, &frame_reg, &frame_offset);
  
    for (action = t->actions; action; action = action->next)
      {
--- 1060,1066 ----
    *stepping_actions = NULL;
  
    gdbarch_virtual_frame_pointer (current_gdbarch, 
! 				 t->loc->address, &frame_reg, &frame_offset);
  
    for (action = t->actions; action; action = action->next)
      {
*************** encode_actions (struct tracepoint *t, ch
*** 1540,1546 ****
  	      else if (0 == strncasecmp ("$arg", action_exp, 4))
  		{
  		  add_local_symbols (collect,
! 				     t->address,
  				     frame_reg,
  				     frame_offset,
  				     'A');
--- 1093,1099 ----
  	      else if (0 == strncasecmp ("$arg", action_exp, 4))
  		{
  		  add_local_symbols (collect,
! 				     t->loc->address,
  				     frame_reg,
  				     frame_offset,
  				     'A');
*************** encode_actions (struct tracepoint *t, ch
*** 1549,1555 ****
  	      else if (0 == strncasecmp ("$loc", action_exp, 4))
  		{
  		  add_local_symbols (collect,
! 				     t->address,
  				     frame_reg,
  				     frame_offset,
  				     'L');
--- 1102,1108 ----
  	      else if (0 == strncasecmp ("$loc", action_exp, 4))
  		{
  		  add_local_symbols (collect,
! 				     t->loc->address,
  				     frame_reg,
  				     frame_offset,
  				     'L');
*************** encode_actions (struct tracepoint *t, ch
*** 1563,1569 ****
  		  struct agent_reqs areqs;
  
  		  exp = parse_exp_1 (&action_exp, 
! 				     block_for_pc (t->address), 1);
  		  old_chain = make_cleanup (free_current_contents, &exp);
  
  		  switch (exp->elts[0].opcode)
--- 1116,1122 ----
  		  struct agent_reqs areqs;
  
  		  exp = parse_exp_1 (&action_exp, 
! 				     block_for_pc (t->loc->address), 1);
  		  old_chain = make_cleanup (free_current_contents, &exp);
  
  		  switch (exp->elts[0].opcode)
*************** encode_actions (struct tracepoint *t, ch
*** 1600,1606 ****
  		      break;
  
  		    default:	/* full-fledged expression */
! 		      aexpr = gen_trace_for_expr (t->address, exp);
  
  		      old_chain1 = make_cleanup_free_agent_expr (aexpr);
  
--- 1153,1159 ----
  		      break;
  
  		    default:	/* full-fledged expression */
! 		      aexpr = gen_trace_for_expr (t->loc->address, exp);
  
  		      old_chain1 = make_cleanup_free_agent_expr (aexpr);
  
*************** remote_set_transparent_ranges (void)
*** 1732,1746 ****
     to the target.  If no errors, 
     Tell target to start a new trace experiment.  */
  
  static void
  trace_start_command (char *args, int from_tty)
  {
!   struct tracepoint *t;
!   char buf[2048];
!   char **tdp_actions;
!   char **stepping_actions;
!   int ndx;
!   struct cleanup *old_chain = NULL;
  
    dont_repeat ();	/* Like "run", dangerous to repeat accidentally.  */
  
--- 1285,1298 ----
     to the target.  If no errors, 
     Tell target to start a new trace experiment.  */
  
+ void download_tracepoint (struct breakpoint *t);
+ 
  static void
  trace_start_command (char *args, int from_tty)
  {
!   VEC(breakpoint_p) *tp_vec = NULL;
!   int ix;
!   struct breakpoint *t;
  
    dont_repeat ();	/* Like "run", dangerous to repeat accidentally.  */
  
*************** trace_start_command (char *args, int fro
*** 1751,1820 ****
        if (strcmp (target_buf, "OK"))
  	error (_("Target does not support this command."));
  
!       ALL_TRACEPOINTS (t)
!       {
! 	char tmp[40];
! 
! 	sprintf_vma (tmp, t->address);
! 	sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", t->number, 
! 		 tmp, /* address */
! 		 t->enabled_p ? 'E' : 'D',
! 		 t->step_count, t->pass_count);
! 
! 	if (t->actions)
! 	  strcat (buf, "-");
! 	putpkt (buf);
! 	remote_get_noisy_reply (&target_buf, &target_buf_size);
! 	if (strcmp (target_buf, "OK"))
! 	  error (_("Target does not support tracepoints."));
! 
! 	if (t->actions)
! 	  {
! 	    encode_actions (t, &tdp_actions, &stepping_actions);
! 	    old_chain = make_cleanup (free_actions_list_cleanup_wrapper,
! 				      tdp_actions);
! 	    (void) make_cleanup (free_actions_list_cleanup_wrapper,
! 				 stepping_actions);
! 
! 	    /* do_single_steps (t); */
! 	    if (tdp_actions)
! 	      {
! 		for (ndx = 0; tdp_actions[ndx]; ndx++)
! 		  {
! 		    QUIT;	/* allow user to bail out with ^C */
! 		    sprintf (buf, "QTDP:-%x:%s:%s%c",
! 			     t->number, tmp, /* address */
! 			     tdp_actions[ndx],
! 			     ((tdp_actions[ndx + 1] || stepping_actions)
! 			      ? '-' : 0));
! 		    putpkt (buf);
! 		    remote_get_noisy_reply (&target_buf,
! 					    &target_buf_size);
! 		    if (strcmp (target_buf, "OK"))
! 		      error (_("Error on target while setting tracepoints."));
! 		  }
! 	      }
! 	    if (stepping_actions)
! 	      {
! 		for (ndx = 0; stepping_actions[ndx]; ndx++)
! 		  {
! 		    QUIT;	/* allow user to bail out with ^C */
! 		    sprintf (buf, "QTDP:-%x:%s:%s%s%s",
! 			     t->number, tmp, /* address */
! 			     ((ndx == 0) ? "S" : ""),
! 			     stepping_actions[ndx],
! 			     (stepping_actions[ndx + 1] ? "-" : ""));
! 		    putpkt (buf);
! 		    remote_get_noisy_reply (&target_buf,
! 					    &target_buf_size);
! 		    if (strcmp (target_buf, "OK"))
! 		      error (_("Error on target while setting tracepoints."));
! 		  }
! 	      }
  
- 	    do_cleanups (old_chain);
- 	  }
-       }
        /* Tell target to treat text-like sections as transparent.  */
        remote_set_transparent_ranges ();
        /* Now insert traps and begin collecting data.  */
--- 1303,1315 ----
        if (strcmp (target_buf, "OK"))
  	error (_("Target does not support this command."));
  
!       tp_vec = all_tracepoints ();
!       for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++)
! 	{
! 	  download_tracepoint (t);
! 	}
!       VEC_free (breakpoint_p, tp_vec);
  
        /* Tell target to treat text-like sections as transparent.  */
        remote_set_transparent_ranges ();
        /* Now insert traps and begin collecting data.  */
*************** trace_start_command (char *args, int fro
*** 1834,1839 ****
--- 1329,1405 ----
      error (_("Trace can only be run on remote targets."));
  }
  
+ /* Send the definition of a single tracepoint to the target.  */
+ 
+ void
+ download_tracepoint (struct breakpoint *t)
+ {
+   char tmp[40];
+   char buf[2048];
+   char **tdp_actions;
+   char **stepping_actions;
+   int ndx;
+   struct cleanup *old_chain = NULL;
+ 
+   sprintf_vma (tmp, (t->loc ? t->loc->address : 0));
+   sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", t->number, 
+ 	   tmp, /* address */
+ 	   (t->enable_state == bp_enabled ? 'E' : 'D'),
+ 	   t->step_count, t->pass_count);
+ 
+   if (t->actions)
+     strcat (buf, "-");
+   putpkt (buf);
+   remote_get_noisy_reply (&target_buf, &target_buf_size);
+   if (strcmp (target_buf, "OK"))
+     error (_("Target does not support tracepoints."));
+ 
+   if (!t->actions)
+     return;
+ 
+   encode_actions (t, &tdp_actions, &stepping_actions);
+   old_chain = make_cleanup (free_actions_list_cleanup_wrapper,
+ 			    tdp_actions);
+   (void) make_cleanup (free_actions_list_cleanup_wrapper, stepping_actions);
+ 
+   /* do_single_steps (t); */
+   if (tdp_actions)
+     {
+       for (ndx = 0; tdp_actions[ndx]; ndx++)
+ 	{
+ 	  QUIT;	/* allow user to bail out with ^C */
+ 	  sprintf (buf, "QTDP:-%x:%s:%s%c",
+ 		   t->number, tmp, /* address */
+ 		   tdp_actions[ndx],
+ 		   ((tdp_actions[ndx + 1] || stepping_actions)
+ 		    ? '-' : 0));
+ 	  putpkt (buf);
+ 	  remote_get_noisy_reply (&target_buf,
+ 				  &target_buf_size);
+ 	  if (strcmp (target_buf, "OK"))
+ 	    error (_("Error on target while setting tracepoints."));
+ 	}
+     }
+   if (stepping_actions)
+     {
+       for (ndx = 0; stepping_actions[ndx]; ndx++)
+ 	{
+ 	  QUIT;	/* allow user to bail out with ^C */
+ 	  sprintf (buf, "QTDP:-%x:%s:%s%s%s",
+ 		   t->number, tmp, /* address */
+ 		   ((ndx == 0) ? "S" : ""),
+ 		   stepping_actions[ndx],
+ 		   (stepping_actions[ndx + 1] ? "-" : ""));
+ 	  putpkt (buf);
+ 	  remote_get_noisy_reply (&target_buf,
+ 				  &target_buf_size);
+ 	  if (strcmp (target_buf, "OK"))
+ 	    error (_("Error on target while setting tracepoints."));
+ 	}
+     }
+   do_cleanups (old_chain);
+ }
+ 
  /* tstop command */
  static void
  trace_stop_command (char *args, int from_tty)
*************** trace_find_outside_command (char *args, 
*** 2284,2363 ****
      error (_("Trace can only be run on remote targets."));
  }
  
- /* save-tracepoints command */
- static void
- tracepoint_save_command (char *args, int from_tty)
- {
-   struct tracepoint *tp;
-   struct action_line *line;
-   FILE *fp;
-   char *i1 = "    ", *i2 = "      ";
-   char *indent, *actionline, *pathname;
-   char tmp[40];
-   struct cleanup *cleanup;
- 
-   if (args == 0 || *args == 0)
-     error (_("Argument required (file name in which to save tracepoints)"));
- 
-   if (tracepoint_chain == 0)
-     {
-       warning (_("save-tracepoints: no tracepoints to save."));
-       return;
-     }
- 
-   pathname = tilde_expand (args);
-   cleanup = make_cleanup (xfree, pathname);
-   if (!(fp = fopen (pathname, "w")))
-     error (_("Unable to open file '%s' for saving tracepoints (%s)"),
- 	   args, safe_strerror (errno));
-   make_cleanup_fclose (fp);
-   
-   ALL_TRACEPOINTS (tp)
-   {
-     if (tp->addr_string)
-       fprintf (fp, "trace %s\n", tp->addr_string);
-     else
-       {
- 	sprintf_vma (tmp, tp->address);
- 	fprintf (fp, "trace *0x%s\n", tmp);
-       }
- 
-     if (tp->pass_count)
-       fprintf (fp, "  passcount %d\n", tp->pass_count);
- 
-     if (tp->actions)
-       {
- 	fprintf (fp, "  actions\n");
- 	indent = i1;
- 	for (line = tp->actions; line; line = line->next)
- 	  {
- 	    struct cmd_list_element *cmd;
- 
- 	    QUIT;		/* allow user to bail out with ^C */
- 	    actionline = line->action;
- 	    while (isspace ((int) *actionline))
- 	      actionline++;
- 
- 	    fprintf (fp, "%s%s\n", indent, actionline);
- 	    if (*actionline != '#')	/* skip for comment lines */
- 	      {
- 		cmd = lookup_cmd (&actionline, cmdlist, "", -1, 1);
- 		if (cmd == 0)
- 		  error (_("Bad action list item: %s"), actionline);
- 		if (cmd_cfunc_eq (cmd, while_stepping_pseudocommand))
- 		  indent = i2;
- 		else if (cmd_cfunc_eq (cmd, end_actions_pseudocommand))
- 		  indent = i1;
- 	      }
- 	  }
-       }
-   }
-   do_cleanups (cleanup);
-   if (from_tty)
-     printf_filtered ("Tracepoints saved to file '%s'.\n", args);
-   return;
- }
- 
  /* info scope command: list the locals for a scope.  */
  static void
  scope_info (char *args, int from_tty)
--- 1850,1855 ----
*************** trace_dump_command (char *args, int from
*** 2503,2509 ****
  {
    struct regcache *regcache;
    struct gdbarch *gdbarch;
!   struct tracepoint *t;
    struct action_line *action;
    char *action_exp, *next_comma;
    struct cleanup *old_cleanups;
--- 1995,2001 ----
  {
    struct regcache *regcache;
    struct gdbarch *gdbarch;
!   struct breakpoint *t;
    struct action_line *action;
    char *action_exp, *next_comma;
    struct cleanup *old_cleanups;
*************** trace_dump_command (char *args, int from
*** 2522,2530 ****
        return;
      }
  
!   ALL_TRACEPOINTS (t)
!     if (t->number == tracepoint_number)
!     break;
  
    if (t == NULL)
      error (_("No known tracepoint matches 'current' tracepoint #%d."),
--- 2014,2020 ----
        return;
      }
  
!   t = get_tracepoint (tracepoint_number);
  
    if (t == NULL)
      error (_("No known tracepoint matches 'current' tracepoint #%d."),
*************** trace_dump_command (char *args, int from
*** 2542,2548 ****
    regcache = get_current_regcache ();
    gdbarch = get_regcache_arch (regcache);
  
!   stepping_frame = (t->address != (regcache_read_pc (regcache)
  				   - gdbarch_decr_pc_after_break (gdbarch)));
  
    for (action = t->actions; action; action = action->next)
--- 2032,2038 ----
    regcache = get_current_regcache ();
    gdbarch = get_regcache_arch (regcache);
  
!   stepping_frame = (t->loc->address != (regcache_read_pc (regcache)
  				   - gdbarch_decr_pc_after_break (gdbarch)));
  
    for (action = t->actions; action; action = action->next)
*************** _initialize_tracepoint (void)
*** 2654,2661 ****
  {
    struct cmd_list_element *c;
  
-   tracepoint_chain = 0;
-   tracepoint_count = 0;
    traceframe_number = -1;
    tracepoint_number = -1;
  
--- 2144,2149 ----
*************** _initialize_tracepoint (void)
*** 2693,2710 ****
  	   _("Tracing of program execution without stopping the program."),
  	   &cmdlist);
  
-   add_info ("tracepoints", tracepoints_info, _("\
- Status of tracepoints, or tracepoint number NUMBER.\n\
- Convenience variable \"$tpnum\" contains the number of the\n\
- last tracepoint set."));
- 
-   add_info_alias ("tp", "tracepoints", 1);
- 
-   c = add_com ("save-tracepoints", class_trace, tracepoint_save_command, _("\
- Save current tracepoint definitions as a script.\n\
- Use the 'source' command in another debug session to restore them."));
-   set_cmd_completer (c, filename_completer);
- 
    add_com ("tdump", class_trace, trace_dump_command,
  	   _("Print everything collected at the current tracepoint."));
  
--- 2181,2186 ----
*************** De-select any trace frame and resume 'li
*** 2762,2773 ****
    add_com ("tstart", class_trace, trace_start_command,
  	   _("Start trace data collection."));
  
-   add_com ("passcount", class_trace, trace_pass_command, _("\
- Set the passcount for a tracepoint.\n\
- The trace will end when the tracepoint has been passed 'count' times.\n\
- Usage: passcount COUNT TPNUM, where TPNUM may also be \"all\";\n\
- if TPNUM is omitted, passcount refers to the last tracepoint defined."));
- 
    add_com ("end", class_trace, end_actions_pseudocommand, _("\
  Ends a list of commands or actions.\n\
  Several GDB commands allow you to enter a list of commands or actions.\n\
--- 2238,2243 ----
*************** Tracepoint actions may include collectin
*** 2802,2838 ****
  single-stepping, or enabling/disabling other tracepoints, \n\
  depending on target's capabilities."));
  
-   add_cmd ("tracepoints", class_trace, delete_trace_command, _("\
- Delete specified tracepoints.\n\
- Arguments are tracepoint numbers, separated by spaces.\n\
- No argument means delete all tracepoints."),
- 	   &deletelist);
- 
-   add_cmd ("tracepoints", class_trace, disable_trace_command, _("\
- Disable specified tracepoints.\n\
- Arguments are tracepoint numbers, separated by spaces.\n\
- No argument means disable all tracepoints."),
- 	   &disablelist);
- 
-   add_cmd ("tracepoints", class_trace, enable_trace_command, _("\
- Enable specified tracepoints.\n\
- Arguments are tracepoint numbers, separated by spaces.\n\
- No argument means enable all tracepoints."),
- 	   &enablelist);
- 
-   c = add_com ("trace", class_trace, trace_command, _("\
- Set a tracepoint at a specified line or function or address.\n\
- Argument may be a line number, function name, or '*' plus an address.\n\
- For a line number or function, trace at the start of its code.\n\
- If an address is specified, trace at that exact address.\n\n\
- Do \"help tracepoints\" for info on other tracepoint commands."));
-   set_cmd_completer (c, location_completer);
- 
-   add_com_alias ("tp", "trace", class_alias, 0);
-   add_com_alias ("tr", "trace", class_alias, 1);
-   add_com_alias ("tra", "trace", class_alias, 1);
-   add_com_alias ("trac", "trace", class_alias, 1);
- 
    target_buf_size = 2048;
    target_buf = xmalloc (target_buf_size);
  }
--- 2272,2277 ----
Index: tracepoint.h
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.h,v
retrieving revision 1.14
diff -p -r1.14 tracepoint.h
*** tracepoint.h	3 Jan 2009 05:57:53 -0000	1.14
--- tracepoint.h	27 Mar 2009 19:10:49 -0000
*************** struct action_line
*** 27,102 ****
      char *action;
    };
  
- /* The data structure for a tracepoint: */
- 
- struct tracepoint
-   {
-     struct tracepoint *next;
- 
-     int enabled_p;
- 
- #if 0
-     /* Type of tracepoint.  (MVS FIXME: needed?) */
-     enum tptype type;
- 
-     /* What to do with this tracepoint after we hit it 
-        MVS FIXME: needed?).  */
-     enum tpdisp disposition;
- #endif
-     /* Number assigned to distinguish tracepoints.  */
-     int number;
- 
-     /* Address to trace at, or NULL if not an instruction tracepoint.
-        (MVS ?) */
-     CORE_ADDR address;
- 
-     /* Line number of this address.  
-        Only matters if address is non-NULL.  */
-     int line_number;
- 
-     /* Source file name of this address.  
-        Only matters if address is non-NULL.  */
-     char *source_file;
- 
-     /* Number of times this tracepoint should single-step 
-        and collect additional data.  */
-     long step_count;
- 
-     /* Number of times this tracepoint should be hit before 
-        disabling/ending.  */
-     int pass_count;
- 
-     /* Chain of action lines to execute when this tracepoint is hit.  */
-     struct action_line *actions;
- 
-     /* Conditional (MVS ?).  */
-     struct expression *cond;
- 
-     /* String we used to set the tracepoint (malloc'd).
-        Only matters if address is non-NULL.  */
-     char *addr_string;
- 
-     /* Language we used to set the tracepoint.  */
-     enum language language;
- 
-     /* Input radix we used to set the tracepoint.  */
-     int input_radix;
- 
-     /* Count of the number of times this tracepoint was taken, dumped
-        with the info, but not used for anything else.  Useful for
-        seeing how many times you hit a tracepoint prior to the program
-        aborting, so you can back up to just before the abort.  */
-     int hit_count;
- 
-     /* Thread number for thread-specific tracepoint, 
-        or -1 if don't care.  */
-     int thread;
- 
-     /* BFD section, in case of overlays: no, I don't know if
-        tracepoints are really gonna work with overlays.  */
-     struct obj_section *section;
-   };
- 
  enum actionline_type
    {
      BADLINE = -1,
--- 27,32 ----
*************** enum actionline_type
*** 105,139 ****
      STEPPING = 2
    };
  
- 
- /* The tracepoint chain of all tracepoints.  */
- 
- extern struct tracepoint *tracepoint_chain;
- 
  extern unsigned long trace_running_p;
  
  /* A hook used to notify the UI of tracepoint operations.  */
  
- void (*deprecated_create_tracepoint_hook) (struct tracepoint *);
- void (*deprecated_delete_tracepoint_hook) (struct tracepoint *);
- void (*deprecated_modify_tracepoint_hook) (struct tracepoint *);
  void (*deprecated_trace_find_hook) (char *arg, int from_tty);
  void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
  
- struct tracepoint *get_tracepoint_by_number (char **, int, int);
  int get_traceframe_number (void);
! void free_actions (struct tracepoint *);
! enum actionline_type validate_actionline (char **, struct tracepoint *);
! 
! 
! /* Walk the following statement or block through all tracepoints.
!    ALL_TRACEPOINTS_SAFE does so even if the statment deletes the
!    current breakpoint.  */
! 
! #define ALL_TRACEPOINTS(t)  for (t = tracepoint_chain; t; t = t->next)
  
- #define ALL_TRACEPOINTS_SAFE(t,tmp)	\
- 	for (t = tracepoint_chain;	\
- 	     t ? (tmp = t->next, 1) : 0;\
- 	     t = tmp)
  #endif	/* TRACEPOINT_H */
--- 35,49 ----
      STEPPING = 2
    };
  
  extern unsigned long trace_running_p;
  
  /* A hook used to notify the UI of tracepoint operations.  */
  
  void (*deprecated_trace_find_hook) (char *arg, int from_tty);
  void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
  
  int get_traceframe_number (void);
! void free_actions (struct breakpoint *);
! enum actionline_type validate_actionline (char **, struct breakpoint *);
  
  #endif	/* TRACEPOINT_H */
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.571
diff -p -r1.571 gdb.texinfo
*** doc/gdb.texinfo	26 Mar 2009 20:58:11 -0000	1.571
--- doc/gdb.texinfo	27 Mar 2009 19:10:50 -0000
*************** This chapter describes the tracepoint co
*** 8555,8566 ****
  @section Commands to Set Tracepoints
  
  Before running such a @dfn{trace experiment}, an arbitrary number of
! tracepoints can be set.  Like a breakpoint (@pxref{Set Breaks}), a
! tracepoint has a number assigned to it by @value{GDBN}.  Like with
! breakpoints, tracepoint numbers are successive integers starting from
! one.  Many of the commands associated with tracepoints take the
! tracepoint number as their argument, to identify which tracepoint to
! work on.
  
  For each tracepoint, you can specify, in advance, some arbitrary set
  of data that you want the target to collect in the trace buffer when
--- 8555,8566 ----
  @section Commands to Set Tracepoints
  
  Before running such a @dfn{trace experiment}, an arbitrary number of
! tracepoints can be set.  A tracepoint is actually a special type of
! breakpoint (@pxref{Set Breaks}), so you can manipulate it using
! standard breakpoint commands. For instance, as with breakpoints,
! tracepoint numbers are successive integers starting from one, and many
! of the commands associated with tracepoints take the tracepoint number
! as their argument, to identify which tracepoint to work on.
  
  For each tracepoint, you can specify, in advance, some arbitrary set
  of data that you want the target to collect in the trace buffer when
*************** local variables, or global data.  Later,
*** 8569,8574 ****
--- 8569,8579 ----
  commands to examine the values these data had at the time the
  tracepoint was hit.
  
+ Tracepoints do not support every breakpoint feature. Conditional
+ expressions and ignore counts on tracepoints have no effect, and
+ tracepoints cannot run @value{GDBN} commands when they are
+ hit. Tracepoints may not be thread-specific either.
+ 
  This section describes commands to set tracepoints and associated
  conditions and actions.
  
*************** conditions and actions.
*** 8587,8602 ****
  @table @code
  @cindex set tracepoint
  @kindex trace
! @item trace
  The @code{trace} command is very similar to the @code{break} command.
! Its argument can be a source line, a function name, or an address in
! the target program.  @xref{Set Breaks}.  The @code{trace} command
! defines a tracepoint, which is a point in the target program where the
! debugger will briefly stop, collect some data, and then allow the
! program to continue.  Setting a tracepoint or changing its commands
! doesn't take effect until the next @code{tstart} command; thus, you
! cannot change the tracepoint attributes once a trace experiment is
! running.
  
  Here are some examples of using the @code{trace} command:
  
--- 8592,8607 ----
  @table @code
  @cindex set tracepoint
  @kindex trace
! @item trace @var{location}
  The @code{trace} command is very similar to the @code{break} command.
! Its argument @var{location} can be a source line, a function name, or
! an address in the target program.  @xref{Set Breaks}.  The
! @code{trace} command defines a tracepoint, which is a point in the
! target program where the debugger will briefly stop, collect some
! data, and then allow the program to continue.  Setting a tracepoint or
! changing its actions doesn't take effect until the next @code{tstart}
! command, and once a trace experiment is running, further changes will
! not have any effect until the next trace experiment starts.
  
  Here are some examples of using the @code{trace} command:
  
*************** of the most recently set tracepoint.
*** 8626,8632 ****
  @cindex tracepoint deletion
  @item delete tracepoint @r{[}@var{num}@r{]}
  Permanently delete one or more tracepoints.  With no argument, the
! default is to delete all tracepoints.
  
  Examples:
  
--- 8631,8638 ----
  @cindex tracepoint deletion
  @item delete tracepoint @r{[}@var{num}@r{]}
  Permanently delete one or more tracepoints.  With no argument, the
! default is to delete all tracepoints. Note that the regular
! @code{delete} command can remove tracepoints also.
  
  Examples:
  
*************** You can abbreviate this command as @code
*** 8643,8648 ****
--- 8649,8656 ----
  @node Enable and Disable Tracepoints
  @subsection Enable and Disable Tracepoints
  
+ These commands are deprecated; they are equivalent to plain @code{disable} and @code{enable}.
+ 
  @table @code
  @kindex disable tracepoint
  @item disable tracepoint @r{[}@var{num}@r{]}
*************** You may abbreviate @code{while-stepping}
*** 8796,8829 ****
  @kindex info tp
  @cindex information about tracepoints
  @item info tracepoints @r{[}@var{num}@r{]}
! Display information about the tracepoint @var{num}.  If you don't specify
! a tracepoint number, displays information about all the tracepoints
! defined so far.  For each tracepoint, the following information is
! shown:
! 
! @itemize @bullet
! @item
! its number
! @item
! whether it is enabled or disabled
! @item
! its address
! @item
! its passcount as given by the @code{passcount @var{n}} command
! @item
! its step count as given by the @code{while-stepping @var{n}} command
! @item
! where in the source files is the tracepoint set
! @item
! its action list as given by the @code{actions} command
! @end itemize
  
  @smallexample
  (@value{GDBP}) @b{info trace}
! Num Enb Address    PassC StepC What
! 1   y   0x002117c4 0     0     <gdb_asm>
! 2   y   0x0020dc64 0     0     in g_test at g_test.c:1375
! 3   y   0x0020b1f4 0     0     in get_data at ../foo.c:41
  (@value{GDBP})
  @end smallexample
  
--- 8804,8831 ----
  @kindex info tp
  @cindex information about tracepoints
  @item info tracepoints @r{[}@var{num}@r{]}
! Display information about the tracepoint @var{num}.  If you don't
! specify a tracepoint number, displays information about all the
! tracepoints defined so far. The format is similar to that used for
! @code{info breakpoints}; in fact, @code{info tracepoints} is the same
! command, simply restricting itself to tracepoints.
! 
! In addition to the basic info common to all types of breakpoints,
! tracepoint listings may include a step count, a pass count, and the
! list of actions. The action lines are prefixed with an @code{A} so
! as to distinguish them from commands.
  
  @smallexample
  (@value{GDBP}) @b{info trace}
! Num     Type           Disp Enb Address    What
! 1       tracepoint     keep y   0x0804ab57 in foo() at main.cxx:7
!         pass count 1200 
!         step count 20 
!       A while-stepping 20
!       A collect globfoo, $regs
!       A end
!       A collect globfoo2
!       A end
  (@value{GDBP})
  @end smallexample
  
Index: gdbtk/generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.29
diff -p -r1.29 gdbtk-bp.c
*** gdbtk/generic/gdbtk-bp.c	25 Mar 2009 23:43:07 -0000	1.29
--- gdbtk/generic/gdbtk-bp.c	27 Mar 2009 19:10:50 -0000
*************** static int
*** 731,737 ****
  gdb_actions_command (ClientData clientData, Tcl_Interp *interp,
  		     int objc, Tcl_Obj *CONST objv[])
  {
!   struct tracepoint *tp;
    Tcl_Obj **actions;
    int nactions, i, len;
    char *number, *args, *action;
--- 731,737 ----
  gdb_actions_command (ClientData clientData, Tcl_Interp *interp,
  		     int objc, Tcl_Obj *CONST objv[])
  {
!   struct breakpoint *tp;
    Tcl_Obj **actions;
    int nactions, i, len;
    char *number, *args, *action;
*************** gdb_get_tracepoint_info (ClientData clie
*** 814,820 ****
  {
    struct symtab_and_line sal;
    int tpnum;
!   struct tracepoint *tp;
    struct action_line *al;
    Tcl_Obj *action_list;
    char *filename, *funcname;
--- 814,820 ----
  {
    struct symtab_and_line sal;
    int tpnum;
!   struct breakpoint *tp;
    struct action_line *al;
    Tcl_Obj *action_list;
    char *filename, *funcname;
*************** gdb_get_tracepoint_info (ClientData clie
*** 831,839 ****
        return TCL_ERROR;
      }
  
!   ALL_TRACEPOINTS (tp)
!     if (tp->number == tpnum)
!       break;
  
    if (tp == NULL)
      {
--- 831,837 ----
        return TCL_ERROR;
      }
  
!   tp = get_tracepoint (tpnum);
  
    if (tp == NULL)
      {
*************** gdb_get_tracepoint_info (ClientData clie
*** 842,864 ****
      }
  
    Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
!   sal = find_pc_line (tp->address, 0);
    filename = symtab_to_filename (sal.symtab);
    if (filename == NULL)
      filename = "N/A";
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewStringObj (filename, -1));
  
!   funcname = pc_function_name (tp->address);
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj
  			    (funcname, -1));
  
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewIntObj (sal.line));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
! 			    Tcl_NewStringObj (core_addr_to_string (tp->address), -1));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
! 			    Tcl_NewIntObj (tp->enabled_p));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewIntObj (tp->pass_count));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
--- 840,862 ----
      }
  
    Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
!   sal = find_pc_line (tp->loc->address, 0);
    filename = symtab_to_filename (sal.symtab);
    if (filename == NULL)
      filename = "N/A";
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewStringObj (filename, -1));
  
!   funcname = pc_function_name (tp->loc->address);
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj
  			    (funcname, -1));
  
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewIntObj (sal.line));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
! 			    Tcl_NewStringObj (core_addr_to_string (tp->loc->address), -1));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
! 			    Tcl_NewIntObj (tp->enable_state == bp_enabled));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			    Tcl_NewIntObj (tp->pass_count));
    Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
*************** gdb_get_tracepoint_list (ClientData clie
*** 887,899 ****
  			 int objc,
  			 Tcl_Obj *CONST objv[])
  {
!   struct tracepoint *tp;
  
    Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
  
!   ALL_TRACEPOINTS (tp)
      Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			      Tcl_NewIntObj (tp->number));
  
    return TCL_OK;
  }
--- 885,901 ----
  			 int objc,
  			 Tcl_Obj *CONST objv[])
  {
!   VEC(breakpoint_p) *tp_vec = NULL;
!   int ix;
!   struct breakpoint *tp;
  
    Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
  
!   tp_vec = all_tracepoints ();
!   for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, tp); ix++)
      Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
  			      Tcl_NewIntObj (tp->number));
+   VEC_free (breakpoint_p, tp_vec);
  
    return TCL_OK;
  }
*************** gdb_trace_status (ClientData clientData,
*** 917,923 ****
  static int
  tracepoint_exists (char *args)
  {
!   struct tracepoint *tp;
    char **canonical;
    struct symtabs_and_lines sals;
    char *file = NULL;
--- 919,927 ----
  static int
  tracepoint_exists (char *args)
  {
!   VEC(breakpoint_p) *tp_vec = NULL;
!   int ix;
!   struct breakpoint *tp;
    char **canonical;
    struct symtabs_and_lines sals;
    char *file = NULL;
*************** tracepoint_exists (char *args)
*** 934,942 ****
  	  strcpy (file, sals.sals[0].symtab->dirname);
  	  strcat (file, sals.sals[0].symtab->filename);
  
! 	  ALL_TRACEPOINTS (tp)
  	    {
! 	      if (tp->address == sals.sals[0].pc)
  		result = tp->number;
  #if 0
  	      /* Why is this here? This messes up assembly traces */
--- 938,947 ----
  	  strcpy (file, sals.sals[0].symtab->dirname);
  	  strcat (file, sals.sals[0].symtab->filename);
  
! 	  tp_vec = all_tracepoints ();
! 	  for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, tp); ix++)
  	    {
! 	      if (tp->loc && tp->loc->address == sals.sals[0].pc)
  		result = tp->number;
  #if 0
  	      /* Why is this here? This messes up assembly traces */
*************** tracepoint_exists (char *args)
*** 946,951 ****
--- 951,957 ----
  		result = tp->number;
  #endif
  	    }
+ 	  VEC_free (breakpoint_p, tp_vec);
  	}
      }
    if (file != NULL)
Index: testsuite/gdb.trace/actions.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/actions.exp,v
retrieving revision 1.9
diff -p -r1.9 actions.exp
*** testsuite/gdb.trace/actions.exp	3 Jan 2009 05:58:07 -0000	1.9
--- testsuite/gdb.trace/actions.exp	27 Mar 2009 19:10:50 -0000
*************** gdb_trace_setactions "5.1b: set actions 
*** 90,132 ****
  	"$trcpt1" \
  	"collect gdb_char_test" "^$"
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "Actions for.* $trcpt1:.*collect gdb_char_test.*$gdb_prompt $" {
! 	pass "5.1c: verify actions set for first tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	fail "5.1c: verify actions set for first tracepoint"
!     }
! }
  
  gdb_trace_setactions "5.1d: set actions for second tracepoint" \
  	"$trcpt2" \
  	"collect gdb_short_test" "^$"
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "Actions for.* $trcpt2:.*collect gdb_short_test.*$gdb_prompt $" {
! 	pass "5.1e: verify actions set for second tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	fail "5.1e: verify actions set for second tracepoint"
!     }
! }
  
  gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
  	"" \
  	"collect gdb_long_test" "^$"
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "Actions for.* $trcpt3:.*collect gdb_long_test.*$gdb_prompt $" {
! 	pass "5.2b: verify actions set for last (default) tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	fail "5.2b: verify actions set for last (default) tracepoint"
!     }
! }
  
  # 5.3 replace actions set earlier
  
--- 90,135 ----
  	"$trcpt1" \
  	"collect gdb_char_test" "^$"
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_char_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
! 		"5.1c: verify actions set for first tracepoint"
  
  gdb_trace_setactions "5.1d: set actions for second tracepoint" \
  	"$trcpt2" \
  	"collect gdb_short_test" "^$"
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_char_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_short_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
! 		"5.1e: verify actions set for second tracepoint"
  
  gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
  	"" \
  	"collect gdb_long_test" "^$"
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_char_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_short_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_long_test.
! \[\t \]+A\[\t \]+end." \
! 		"5.1e: verify actions set for second tracepoint"
  
  # 5.3 replace actions set earlier
  
*************** gdb_trace_setactions "5.3a: reset action
*** 134,148 ****
  	"$trcpt1" \
  	"collect gdb_struct1_test" "^$"
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "Actions for.* $trcpt1:.*collect gdb_struct1_test.*$gdb_prompt $" {
! 	pass "5.3b: verify actions set for first tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	fail "5.3b: verify actions set for first tracepoint"
!     }
! }
  
  #
  # test end command (all by itself)
--- 137,154 ----
  	"$trcpt1" \
  	"collect gdb_struct1_test" "^$"
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_struct1_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_short_test.
! \[\t \]+A\[\t \]+end.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+A\[\t \]+collect gdb_long_test.
! \[\t \]+A\[\t \]+end." \
! 		"5.3b: verify actions set for first tracepoint"
  
  #
  # test end command (all by itself)
Index: testsuite/gdb.trace/deltrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/deltrace.exp,v
retrieving revision 1.10
diff -p -r1.10 deltrace.exp
*** testsuite/gdb.trace/deltrace.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/deltrace.exp	27 Mar 2009 19:10:50 -0000
*************** gdb_test "trace gdb_asm_test" "Tracepoin
*** 67,73 ****
  gdb_test "trace $testline1"   "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \
  			"3.1a: set three tracepoints"
  
  send_gdb "delete tracepoints\n"
--- 67,76 ----
  gdb_test "trace $testline1"   "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  			"3.1a: set three tracepoints"
  
  send_gdb "delete tracepoints\n"
*************** if { $trcpt1 <= 0 || $trcpt2 <= 0 || $tr
*** 98,104 ****
  }
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_recursion_test.*" \
  			"3.2a: set three tracepoints"
  
  #gdb_test "delete tracepoint $trcpt1" "" ""
--- 101,110 ----
  }
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  			"3.2a: set three tracepoints"
  
  #gdb_test "delete tracepoint $trcpt1" "" ""
*************** gdb_expect {
*** 118,138 ****
      }
  }
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" {
! 	fail "3.2c: verify delete first tracepoint (argh)"
!     }
!     -re "$trcpt2\[\t \]+y.*gdb_asm_test.*\[\r\n\t ]+$trcpt3\[\t \]+y.* in gdb_recursion_test at .*$gdb_prompt $" {
! 	pass "3.2c: verify delete first tracepoint"
!     }
!     -re ".*$gdb_prompt $" {
! 	fail "3.2c: verify delete first tracepoint (mumble)" 
!     }
!     timeout {
! 	fail "3.2c: verify delete first tracepoint (timeout)"
!     }
! }
  
  #gdb_test "delete tracepoint $trcpt2" "" ""
  send_gdb "delete tracepoint $trcpt2\n"
--- 124,134 ----
      }
  }
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
! 			"3.2c: verify delete first tracepoint"
  
  #gdb_test "delete tracepoint $trcpt2" "" ""
  send_gdb "delete tracepoint $trcpt2\n"
*************** gdb_expect {
*** 151,174 ****
      }
  }
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" {
! 	fail "3.2e: verify delete second tracepoint"
!     }
!     -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" {
! 	fail "3.2e: verify delete second tracepoint"
!     }
!     -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
! 	pass "3.2e: verify delete second tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	fail "3.2e: verify delete second tracepoint" 
!     }
!     timeout {
! 	fail "3.2e: verify delete second tracepoint (timeout)"
!     }
! }
  
  #gdb_test "delete tracepoint $trcpt3" "" ""
  send_gdb "delete tracepoint $trcpt3\n"
--- 147,156 ----
      }
  }
  
! gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
! 			"3.2e: verify delete second tracepoint"
  
  #gdb_test "delete tracepoint $trcpt3" "" ""
  send_gdb "delete tracepoint $trcpt3\n"
*************** gdb_expect {
*** 188,205 ****
  }
  
  # send_gdb "ARF! \\n\n"
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
! 	fail "3.2g: verify delete third tracepoint"
!     }
!     -re "$gdb_prompt $" {
! 	pass "3.2g: verify delete third tracepoint"
!     }
!     timeout {
! 	fail "3.2g: verify delete third tracepoint (timeout)" 
!     }
! }
  
  # 3.3 delete three tracepoints at once
  gdb_delete_tracepoints
--- 170,178 ----
  }
  
  # send_gdb "ARF! \\n\n"
! gdb_test "info tracepoints" \
!     "No tracepoints." \
! 			"3.2g: verify delete third tracepoint"
  
  # 3.3 delete three tracepoints at once
  gdb_delete_tracepoints
*************** if { $trcpt1 <= 0 || $trcpt2 <= 0 || $tr
*** 212,218 ****
  }
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \
  			"3.3a: set three tracepoints"
  
  #gdb_test "delete tracepoint $trcpt1 $trcpt2 $trcpt3" "" ""
--- 185,194 ----
  }
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  			"3.3a: set three tracepoints"
  
  #gdb_test "delete tracepoint $trcpt1 $trcpt2 $trcpt3" "" ""
*************** gdb_expect {
*** 232,263 ****
      }
  }
  
! send_gdb "info tracepoints\n"
! gdb_expect {
!     -re "$trcpt1\[\t \]+y\[\t \]+0x.*in gdb_c_test.*$gdb_prompt $" {
! 	fail "3.3c: verify delete three tracepoints (first one persists)"
!     }
!     -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" {
! 	fail "3.3c: verify delete three tracepoints (second one persists)"
!     }
!     -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
! 	fail "3.3c: verify delete three tracepoints (third one persists)"
!     }
!     -re "$gdb_prompt $" {
! 	pass "3.3c: verify delete three tracepoints" 
!     }
!     timeout { 
! 	fail "3.3c: verify delete three tracepoints (timeout)"
!     }
! }
  
  # 3.4 delete invalid tracepoint number
  gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
!     "No tracepoint number [expr $trcpt2 + $trcpt3]." \
  			"3.4: delete invalid tracepoint number"
  
  # 3.5 delete tracepoint number zero
! gdb_test "delete tracepoint 0" "bad tracepoint number at or near '0'" \
  			"3.5: delete tracepoint number zero"
  
  # 3.6 help delete tracepoints
--- 208,224 ----
      }
  }
  
! gdb_test "info tracepoints" \
!     "No tracepoints." \
! 			"3.3c: verify delete three tracepoints" 
  
  # 3.4 delete invalid tracepoint number
  gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
!     "No breakpoint number [expr $trcpt2 + $trcpt3]." \
  			"3.4: delete invalid tracepoint number"
  
  # 3.5 delete tracepoint number zero
! gdb_test "delete tracepoint 0" "bad breakpoint number at or near '0'" \
  			"3.5: delete tracepoint number zero"
  
  # 3.6 help delete tracepoints
Index: testsuite/gdb.trace/infotrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/infotrace.exp,v
retrieving revision 1.10
diff -p -r1.10 infotrace.exp
*** testsuite/gdb.trace/infotrace.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/infotrace.exp	27 Mar 2009 19:10:50 -0000
*************** if { $c_test_num <= 0 || $asm_test_num <
*** 61,81 ****
  
  # 2.1 info tracepoints (all)
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*$c_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*$asm_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*" \
      "2.1: info tracepoints (all)"
  
  # 2.2 info tracepoint (specific)
  gdb_test "info tracepoint $c_test_num" \
!     "$c_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*" \
      "2.2a: info tracepoint $c_test_num (gdb_c_test)"
  
  gdb_test "info tracepoint $asm_test_num" \
!     "$asm_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*" \
      "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
  
  # 2.3 info tracepoint (invalid tracepoint number)
  gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
!     "No tracepoint number [expr $c_test_num + $asm_test_num]." \
      "2.3: info tracepoint (invalid tracepoint number)"
  
  # 2.4 info tracepoints (list of numbers)
--- 61,85 ----
  
  # 2.1 info tracepoints (all)
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
      "2.1: info tracepoints (all)"
  
  # 2.2 info tracepoint (specific)
  gdb_test "info tracepoint $c_test_num" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+." \
      "2.2a: info tracepoint $c_test_num (gdb_c_test)"
  
  gdb_test "info tracepoint $asm_test_num" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
      "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
  
  # 2.3 info tracepoint (invalid tracepoint number)
  gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
!     "No breakpoint or watchpoint number [expr $c_test_num + $asm_test_num]." \
      "2.3: info tracepoint (invalid tracepoint number)"
  
  # 2.4 info tracepoints (list of numbers)
Index: testsuite/gdb.trace/passcount.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/passcount.exp,v
retrieving revision 1.10
diff -p -r1.10 passcount.exp
*** testsuite/gdb.trace/passcount.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/passcount.exp	27 Mar 2009 19:10:50 -0000
*************** if { $trcpt1 <= 0 || $trcpt2 <= 0 || $tr
*** 72,78 ****
  # 4.1 passcount of specified tracepoint
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
  			"4.1a: set three tracepoints, passcounts all zero"
  
  gdb_test "passcount 2 $trcpt1" \
--- 72,81 ----
  # 4.1 passcount of specified tracepoint
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  			"4.1a: set three tracepoints, passcounts all zero"
  
  gdb_test "passcount 2 $trcpt1" \
*************** gdb_test "passcount 2 $trcpt1" \
*** 80,86 ****
  	"4.1b: set 1st tracepoint's passcount to two"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
  	"4.1c: verify 1st tracepoint's passcount set to two"
  
  gdb_test "passcount 4 $trcpt2" \
--- 83,93 ----
  	"4.1b: set 1st tracepoint's passcount to two"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 2 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  	"4.1c: verify 1st tracepoint's passcount set to two"
  
  gdb_test "passcount 4 $trcpt2" \
*************** gdb_test "passcount 4 $trcpt2" \
*** 88,94 ****
  	"4.1d: set 2nd tracepoint's passcount to four"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
  	"4.1c: verify 2nd tracepoint's passcount set to four"
  
  # 4.2 passcount of last (default) tracepoint
--- 95,106 ----
  	"4.1d: set 2nd tracepoint's passcount to four"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 2 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
  	"4.1c: verify 2nd tracepoint's passcount set to four"
  
  # 4.2 passcount of last (default) tracepoint
*************** gdb_test "passcount 6" \
*** 98,104 ****
  	"4.2b: set last (default) tp's passcount to six"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+6\[\t \]+.*in gdb_recursion_test.*" \
  	"4.2b: verify last (default) tp's passcount set to six"
  
  # 4.3 run until stopped explicitly by user
--- 110,122 ----
  	"4.2b: set last (default) tp's passcount to six"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 2 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 6 .*" \
  	"4.2b: verify last (default) tp's passcount set to six"
  
  # 4.3 run until stopped explicitly by user
*************** gdb_test "passcount 7" \
*** 111,117 ****
  	"4.4a: reset last (default) tp's passcount to seven"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+7\[\t \]+.*in gdb_recursion_test.*" \
  	"4.4a: verify reset last (default) tp's passcount to seven"
  
  gdb_test "passcount 5 $trcpt2" \
--- 129,141 ----
  	"4.4a: reset last (default) tp's passcount to seven"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 2 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 7 .*" \
  	"4.4a: verify reset last (default) tp's passcount to seven"
  
  gdb_test "passcount 5 $trcpt2" \
*************** gdb_test "passcount 5 $trcpt2" \
*** 119,125 ****
  	"4.4b: reset second tracepoint's passcount to five"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+5\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+7\[\t \]+.*in gdb_recursion_test.*" \
  	"4.4c: verify reset second tracepoint's passcount to five"
  
  # 4.20 <FIXME test number> passcount for "all"
--- 143,155 ----
  	"4.4b: reset second tracepoint's passcount to five"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 2 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 5 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 7 .*" \
  	"4.4c: verify reset second tracepoint's passcount to five"
  
  # 4.20 <FIXME test number> passcount for "all"
*************** gdb_test "passcount 3 all" \
*** 129,135 ****
  	"4.20a: set all three passcounts to three"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*in gdb_recursion_test.*" \
  	"4.20a: set all three passcounts to three"
  
  gdb_test "passcount 4 all" \
--- 159,171 ----
  	"4.20a: set all three passcounts to three"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 3 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 3 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 3 .*"  \
  	"4.20a: set all three passcounts to three"
  
  gdb_test "passcount 4 all" \
*************** gdb_test "passcount 4 all" \
*** 137,143 ****
  	"4.20a: reset all three passcounts to four"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
  	"4.20b: reset all three passcounts to four"
  
  # 4.5 Verify trace stops on first "satisfied" passcount
--- 173,185 ----
  	"4.20a: reset all three passcounts to four"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*"  \
  	"4.20b: reset all three passcounts to four"
  
  # 4.5 Verify trace stops on first "satisfied" passcount
*************** gdb_test "passcount 0 $trcpt1" \
*** 150,156 ****
  	"4.6: set passcount to zero"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
  	"4.6: set passcount to zero"
  
  # 4.7 (test a very large passcount)
--- 192,203 ----
  	"4.6: set passcount to zero"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*"  \
  	"4.6: set passcount to zero"
  
  # 4.7 (test a very large passcount)
*************** gdb_test "passcount 32767 $trcpt1" \
*** 160,166 ****
  	"4.7: set passcount to large number (32767)"
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+32767\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
  	"4.7: set passcount to large number (32767)"
  
  # 4.8 set passcount for invalid tracepoint
--- 207,219 ----
  	"4.7: set passcount to large number (32767)"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 32767 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
! \[\t \]+pass count 4 .*"  \
  	"4.7: set passcount to large number (32767)"
  
  # 4.8 set passcount for invalid tracepoint
*************** gdb_test "passcount 1 [expr $trcpt2 + $t
*** 172,175 ****
  # 4.9 help passcount
  gdb_test "help passcount" "Set the passcount for a tracepoint.*" \
  	"4.9: help passcount"
- 
--- 225,227 ----
Index: testsuite/gdb.trace/save-trace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/save-trace.exp,v
retrieving revision 1.10
diff -p -r1.10 save-trace.exp
*** testsuite/gdb.trace/save-trace.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/save-trace.exp	27 Mar 2009 19:10:50 -0000
*************** proc gdb_verify_tracepoints { testname }
*** 96,108 ****
      set result "pass";
      send_gdb "info tracepoints\n";
      gdb_expect 10 {
! 	-re "y\[\t \]+0x\[0-9a-fA-F\]+\[\t \]+(\[0-9\]+)\[\t \]+(\[0-9\]+)\[\t \]+in gdb_recursion_test\[^\r\n\]+" {
! 	    if { $expect_out(1,string) != $expect_out(2,string) } {
! 		#set result "fail";
! 	    }
! 	    if { $expect_out(1,string) != $ourstate } {
! 		set result "fail";
! 	    }
  	    incr ourstate;
  	    exp_continue;
  	}
--- 96,105 ----
      set result "pass";
      send_gdb "info tracepoints\n";
      gdb_expect 10 {
! 	-re "\[0-9\]+\[\t \]+tracepoint\[\t \]+keep y\[\t \]+0x\[0-9a-fA-F\]+ in gdb_recursion_test\[^\r\n\]+" {
! #	    if { $expect_out(1,string) != $ourstate } {
! #		set result "fail";
! #	    }
  	    incr ourstate;
  	    exp_continue;
  	}
Index: testsuite/gdb.trace/tracecmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/tracecmd.exp,v
retrieving revision 1.10
diff -p -r1.10 tracecmd.exp
*** testsuite/gdb.trace/tracecmd.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/tracecmd.exp	27 Mar 2009 19:10:50 -0000
*************** gdb_test "info trace" "No tracepoints.*"
*** 87,92 ****
--- 87,93 ----
  
  # 1.3 trace line in invalid source file
  gdb_delete_tracepoints
+ gdb_test "set breakpoint pending off" ""
  gdb_test "trace NoSuChFiLe.c:1" "No source file named NoSuChFiLe.c." \
  	"1.3a: trace invalid source file"
  gdb_test "info trace" "No tracepoints.*" \
*************** gdb_test "info trace" "$c_test_addr.*in 
*** 145,151 ****
  # no address is invalid
  
  # 1.9 trace no arguments
! gdb_test "trace" "trace command requires an argument" \
  	"1.9: trace <no arguments>"
  
  # 1.10 set large number of tracepoints
--- 146,152 ----
  # no address is invalid
  
  # 1.9 trace no arguments
! gdb_test "trace" "No default breakpoint address now." \
  	"1.9: trace <no arguments>"
  
  # 1.10 set large number of tracepoints
Index: testsuite/gdb.trace/while-stepping.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/while-stepping.exp,v
retrieving revision 1.10
diff -p -r1.10 while-stepping.exp
*** testsuite/gdb.trace/while-stepping.exp	3 Jan 2009 05:58:07 -0000	1.10
--- testsuite/gdb.trace/while-stepping.exp	27 Mar 2009 19:10:50 -0000
*************** if { $trcpt1 <= 0 } then {
*** 61,67 ****
  # 5.12 basic while-stepping command (collect regs)
  
  gdb_test "info tracepoints" \
! 	"Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+0\[\t \]+.*in gdb_c_test.*" \
  	"5.12: set a tracepoint, stepcount is zero"
  
  set stepcount 12
--- 61,68 ----
  # 5.12 basic while-stepping command (collect regs)
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
  	"5.12: set a tracepoint, stepcount is zero"
  
  set stepcount 12
*************** gdb_trace_setactions "5.12: set stepcoun
*** 73,83 ****
  	"end" ""
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*" \
  	"5.12: confirm stepcount set to $stepcount"
  
  gdb_test "info tracepoints" \
!     "Num Enb Address\[ \]+PassC StepC What.*
  .*while-stepping $stepcount.*" \
  	"5.12: info trace shows \"while-stepping\""
  
--- 74,86 ----
  	"end" ""
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! \[\t \]+step count 12 .*" \
  	"5.12: confirm stepcount set to $stepcount"
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
  .*while-stepping $stepcount.*" \
  	"5.12: info trace shows \"while-stepping\""
  
*************** gdb_trace_setactions "5.16: step without
*** 108,113 ****
  	"end" ""
  
  gdb_test "info tracepoints" \
! 	".*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*\[ \t\]+Actions for tracepoint $trcpt1:.*\[ \t\]+while-stepping $stepcount.*\[ \t\]+end.*\[ \t\]+end.*" \
  	"5.16: confirm actions, step without collecting anything"
  
--- 111,120 ----
  	"end" ""
  
  gdb_test "info tracepoints" \
!     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
! .*while-stepping $stepcount.*
! .*end.*
! .*end.*" \
  	"5.16: confirm actions, step without collecting anything"
  

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