* top.c (init_main): Make `set history file name' complete on file
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index c33e552e2184ec59cebeb941045a1fafb7e606ca..c5147deb25fd4eec35bc127ba5d17a5564ccf9c3 100644 (file)
@@ -1,5 +1,5 @@
 /* Tracing functionality for remote targets in custom GDB protocol
-   Copyright 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -32,6 +32,8 @@
 #include "tracepoint.h"
 #include "remote.h"
 #include "linespec.h"
+#include "completer.h"
+#include "regcache.h"
 
 #include "ax.h"
 #include "ax-gdb.h"
@@ -341,7 +343,7 @@ set_raw_tracepoint (struct symtab_and_line sal)
   struct cleanup *old_chain;
 
   t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
-  old_chain = make_cleanup (free, t);
+  old_chain = make_cleanup (xfree, t);
   memset (t, 0, sizeof (*t));
   t->address = sal.pc;
   if (sal.symtab == NULL)
@@ -576,13 +578,13 @@ tracepoint_operation (struct tracepoint *t, int from_tty,
        delete_tracepoint_hook (t);
 
       if (t->addr_string)
-       free (t->addr_string);
+       xfree (t->addr_string);
       if (t->source_file)
-       free (t->source_file);
+       xfree (t->source_file);
       if (t->actions)
        free_actions (t);
 
-      free (t);
+      xfree (t);
       break;
     }
 }
@@ -971,7 +973,7 @@ validate_actionline (char **line, struct tracepoint *t)
            error ("expression too complicated, try simplifying");
 
          ax_reqs (aexpr, &areqs);
-         (void) make_cleanup (free, areqs.reg_mask);
+         (void) make_cleanup (xfree, areqs.reg_mask);
 
          if (areqs.flaw != agent_flaw_none)
            error ("malformed expression");
@@ -1022,8 +1024,8 @@ free_actions (struct tracepoint *t)
     {
       next = line->next;
       if (line->action)
-       free (line->action);
-      free (line);
+       xfree (line->action);
+      xfree (line);
     }
   t->actions = NULL;
 }
@@ -1457,9 +1459,9 @@ free_actions_list (char **actions_list)
     return;
 
   for (ndx = 0; actions_list[ndx]; ndx++)
-    free (actions_list[ndx]);
+    xfree (actions_list[ndx]);
 
-  free (actions_list);
+  xfree (actions_list);
 }
 
 /* render all actions into gdb protocol */
@@ -2098,7 +2100,7 @@ trace_find_line_command (char *args, int from_tty)
          sal = sals.sals[0];
        }
 
-      old_chain = make_cleanup (free, sals.sals);
+      old_chain = make_cleanup (xfree, sals.sals);
       if (sal.symtab == 0)
        {
          printf_filtered ("TFIND: No line number information available");
@@ -2600,6 +2602,8 @@ get_traceframe_number (void)
 void
 _initialize_tracepoint (void)
 {
+  struct cmd_list_element *c;
+
   tracepoint_chain = 0;
   tracepoint_count = 0;
   traceframe_number = -1;
@@ -2651,9 +2655,10 @@ last tracepoint set.");
 
   add_info_alias ("tp", "tracepoints", 1);
 
-  add_com ("save-tracepoints", class_trace, tracepoint_save_command,
-          "Save current tracepoint definitions as a script.\n\
+  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.");
+  c->completer = filename_completer;
 
   add_com ("tdump", class_trace, trace_dump_command,
           "Print everything collected at the current tracepoint.");
This page took 0.026377 seconds and 4 git commands to generate.