2004-05-10 Randolph Chung <tausq@debian.org>
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index 7d09ff332efb2a14e6fe49df98edc95aff02c084..590e09c2fa811c022624f84dc3caf0d527307d1f 100644 (file)
@@ -44,8 +44,8 @@
 #include "ax-gdb.h"
 
 /* readline include files */
-#include <readline/readline.h>
-#include <readline/history.h>
+#include "readline/readline.h"
+#include "readline/history.h"
 
 /* readline defines this.  */
 #undef savestring
@@ -65,9 +65,9 @@
 #define MAX_AGENT_EXPR_LEN     184
 
 
-extern void (*readline_begin_hook) (char *, ...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *, ...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
 extern void x_command (char *, int);
 extern int addressprint;       /* Print machine addresses? */
 
@@ -334,7 +334,7 @@ set_traceframe_context (CORE_ADDR trace_pc)
 static struct tracepoint *
 set_raw_tracepoint (struct symtab_and_line sal)
 {
-  register struct tracepoint *t, *tc;
+  struct tracepoint *t, *tc;
   struct cleanup *old_chain;
 
   t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
@@ -392,7 +392,7 @@ trace_command (char *arg, int from_tty)
     printf_filtered ("TRACE %s\n", arg);
 
   addr_start = arg;
-  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical);
+  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? */
@@ -787,8 +787,8 @@ trace_actions_command (char *args, int from_tty)
 
       if (from_tty)
        {
-         if (readline_begin_hook)
-           (*readline_begin_hook) ("%s  %s\n", tmpbuf, end_msg);
+         if (deprecated_readline_begin_hook)
+           (*deprecated_readline_begin_hook) ("%s  %s\n", tmpbuf, end_msg);
          else if (input_from_terminal_p ())
            printf_filtered ("%s\n%s\n", tmpbuf, end_msg);
        }
@@ -797,8 +797,8 @@ trace_actions_command (char *args, int from_tty)
       t->step_count = 0;       /* read_actions may set this */
       read_actions (t);
 
-      if (readline_end_hook)
-       (*readline_end_hook) ();
+      if (deprecated_readline_end_hook)
+       (*deprecated_readline_end_hook) ();
       /* tracepoints_changed () */
     }
   /* else just return */
@@ -842,8 +842,8 @@ read_actions (struct tracepoint *t)
       gdb_flush (gdb_stdout);
       gdb_flush (gdb_stderr);
 
-      if (readline_hook && instream == NULL)
-       line = (*readline_hook) (prompt);
+      if (deprecated_readline_hook && instream == NULL)
+       line = (*deprecated_readline_hook) (prompt);
       else if (instream == stdin && ISATTY (instream))
        {
          line = gdb_readline_wrapper (prompt);
@@ -914,6 +914,10 @@ validate_actionline (char **line, struct tracepoint *t)
   struct cleanup *old_chain = NULL;
   char *p;
 
+  /* if EOF is typed, *line is NULL */
+  if (*line == NULL)
+    return END;
+
   for (p = *line; isspace ((int) *p);)
     p++;
 
@@ -1215,7 +1219,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym,
       /* check for doubles stored in two registers */
       /* FIXME: how about larger types stored in 3 or more regs? */
       if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
-         len > REGISTER_RAW_SIZE (reg))
+         len > DEPRECATED_REGISTER_RAW_SIZE (reg))
        add_register (collect, reg + 1);
       break;
     case LOC_REF_ARG:
@@ -1800,8 +1804,8 @@ trace_start_command (char *args, int from_tty)
       set_tracepoint_num (-1);
       set_traceframe_context (-1);
       trace_running_p = 1;
-      if (trace_start_stop_hook)
-       trace_start_stop_hook (1, from_tty);
+      if (deprecated_trace_start_stop_hook)
+       deprecated_trace_start_stop_hook (1, from_tty);
 
     }
   else
@@ -1819,8 +1823,8 @@ trace_stop_command (char *args, int from_tty)
       if (strcmp (target_buf, "OK"))
        error ("Bogus reply from target: %s", target_buf);
       trace_running_p = 0;
-      if (trace_start_stop_hook)
-       trace_start_stop_hook (0, from_tty);
+      if (deprecated_trace_start_stop_hook)
+       deprecated_trace_start_stop_hook (0, from_tty);
     }
   else
     error ("Trace can only be run on remote targets.");
@@ -1931,7 +1935,7 @@ finish_tfind_command (char *msg,
 
   if (from_tty)
     {
-      int source_only;
+      enum print_what print_what;
 
       /* NOTE: in immitation of the step command, try to determine
          whether we have made a transition from one function to another.
@@ -1947,13 +1951,11 @@ finish_tfind_command (char *msg,
          (old_frame_addr == 0 ||
           get_frame_base (get_current_frame ()) == 0 ||
           old_frame_addr == get_frame_base (get_current_frame ())))
-       source_only = -1;
+       print_what = SRC_LINE;
       else
-       source_only = 1;
+       print_what = SRC_AND_LOC;
 
-      print_stack_frame (deprecated_selected_frame,
-                        frame_relative_level (deprecated_selected_frame),
-                        source_only);
+      print_stack_frame (get_selected_frame (), 1, print_what);
       do_displays ();
     }
 }
@@ -1981,8 +1983,8 @@ trace_find_command (char *args, int from_tty)
 
   if (target_is_remote ())
     {
-      if (trace_find_hook)
-       trace_find_hook (args, from_tty);
+      if (deprecated_trace_find_hook)
+       deprecated_trace_find_hook (args, from_tty);
 
       if (args == 0 || *args == 0)
        {                       /* TFIND with no args means find NEXT trace frame. */
@@ -2341,7 +2343,7 @@ scope_info (char *args, int from_tty)
   if (args == 0 || *args == 0)
     error ("requires an argument (function, line or *addr) to define a scope");
 
-  sals = decode_line_1 (&args, 1, NULL, 0, &canonical);
+  sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
   if (sals.nelts == 0)
     return;                    /* presumably decode_line_1 has already warned */
 
This page took 0.027296 seconds and 4 git commands to generate.