* gdbserver/low-hppabsd.c (read_inferior_memory): Add explicit
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index 83dce01784158c4b2b076193e7a5ed8efb93cb82..888f54de8762d1ad6ff7b5aa9684b925a85c8b49 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.
 
@@ -31,6 +31,8 @@
 #include "inferior.h"
 #include "tracepoint.h"
 #include "remote.h"
+#include "linespec.h"
+#include "regcache.h"
 
 #include "ax.h"
 #include "ax-gdb.h"
@@ -340,7 +342,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)
@@ -465,7 +467,7 @@ tracepoints_info (char *tpnum_exp, int from_tty)
   int tpnum = -1;
 
   if (tpnum_exp)
-    tpnum = parse_and_eval_address (tpnum_exp);
+    tpnum = parse_and_eval_long (tpnum_exp);
 
   ALL_TRACEPOINTS (t)
     if (tpnum == -1 || tpnum == t->number)
@@ -575,13 +577,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;
     }
 }
@@ -889,7 +891,7 @@ read_actions (struct tracepoint *t)
   if (job_control)
     signal (STOP_SIGNAL, SIG_DFL);
 #endif
-  immediate_quit = 0;
+  immediate_quit--;
   discard_cleanups (old_chain);
 }
 
@@ -970,7 +972,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");
@@ -1021,8 +1023,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;
 }
@@ -1265,7 +1267,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym,
       printf_filtered ("Don't know LOC_UNRESOLVED %s\n", SYMBOL_NAME (sym));
       break;
     case LOC_OPTIMIZED_OUT:
-      printf_filtered ("%s has been optimized out of existance.\n",
+      printf_filtered ("%s has been optimized out of existence.\n",
                       SYMBOL_NAME (sym));
       break;
     }
@@ -1456,9 +1458,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 */
@@ -1625,8 +1627,8 @@ encode_actions (struct tracepoint *t, char ***tdp_actions,
   memrange_sortmerge (&tracepoint_list);
   memrange_sortmerge (&stepping_list);
 
-  *tdp_actions = stringify_collection_list (&tracepoint_list, &tdp_buff);
-  *stepping_actions = stringify_collection_list (&stepping_list, &step_buff);
+  *tdp_actions = stringify_collection_list (&tracepoint_list, tdp_buff);
+  *stepping_actions = stringify_collection_list (&stepping_list, step_buff);
 }
 
 static void
@@ -1986,7 +1988,7 @@ trace_find_command (char *args, int from_tty)
          frameno = traceframe_number - 1;
        }
       else
-       frameno = parse_and_eval_address (args);
+       frameno = parse_and_eval_long (args);
 
       if (frameno < -1)
        error ("invalid input (%d is less than zero)", frameno);
@@ -2055,7 +2057,7 @@ trace_find_tracepoint_command (char *args, int from_tty)
        else
          tdp = tracepoint_number;      /* default is current TDP */
       else
-       tdp = parse_and_eval_address (args);
+       tdp = parse_and_eval_long (args);
 
       sprintf (target_buf, "QTFrame:tdp:%x", tdp);
       finish_tfind_command (target_buf, sizeof (target_buf), from_tty);
@@ -2097,7 +2099,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");
@@ -2445,8 +2447,9 @@ scope_info (char *args, int from_tty)
 
 /* worker function (cleanup) */
 static void
-replace_comma (char *comma)
+replace_comma (void *data)
 {
+  char *comma = data;
   *comma = ',';
 }
 
@@ -2598,6 +2601,8 @@ get_traceframe_number (void)
 void
 _initialize_tracepoint (void)
 {
+  struct cmd_list_element *c;
+
   tracepoint_chain = 0;
   tracepoint_count = 0;
   traceframe_number = -1;
@@ -2649,9 +2654,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.025727 seconds and 4 git commands to generate.