Remove IRIX 5 <sys/proc.h> _KMEMUSER workaround
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index bc45470153e504f631e8a87340a2f008fe1ce6e9..e5c353c113911139f85346decf942e9dcb885eeb 100644 (file)
@@ -56,6 +56,7 @@
 #include "rsp-low.h"
 #include "tracefile.h"
 #include "location.h"
+#include <algorithm>
 
 /* readline include files */
 #include "readline/readline.h"
@@ -1428,14 +1429,14 @@ encode_actions_1 (struct command_line *action,
 
              if (0 == strncasecmp ("$reg", action_exp, 4))
                {
-                 for (i = 0; i < gdbarch_num_regs (tloc->gdbarch); i++)
+                 for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
                    add_register (collect, i);
                  action_exp = strchr (action_exp, ',');        /* more? */
                }
              else if (0 == strncasecmp ("$arg", action_exp, 4))
                {
                  add_local_symbols (collect,
-                                    tloc->gdbarch,
+                                    target_gdbarch (),
                                     tloc->address,
                                     frame_reg,
                                     frame_offset,
@@ -1446,7 +1447,7 @@ encode_actions_1 (struct command_line *action,
              else if (0 == strncasecmp ("$loc", action_exp, 4))
                {
                  add_local_symbols (collect,
-                                    tloc->gdbarch,
+                                    target_gdbarch (),
                                     tloc->address,
                                     frame_reg,
                                     frame_offset,
@@ -1459,7 +1460,7 @@ encode_actions_1 (struct command_line *action,
                  struct cleanup *old_chain1 = NULL;
 
                  aexpr = gen_trace_for_return_address (tloc->address,
-                                                       tloc->gdbarch,
+                                                       target_gdbarch (),
                                                        trace_string);
 
                  old_chain1 = make_cleanup_free_agent_expr (aexpr);
@@ -1513,7 +1514,7 @@ encode_actions_1 (struct command_line *action,
                      {
                        const char *name = &exp->elts[2].string;
 
-                       i = user_reg_map_name_to_regnum (tloc->gdbarch,
+                       i = user_reg_map_name_to_regnum (target_gdbarch (),
                                                         name, strlen (name));
                        if (i == -1)
                          internal_error (__FILE__, __LINE__,
@@ -1543,7 +1544,7 @@ encode_actions_1 (struct command_line *action,
 
                        collect_symbol (collect,
                                        exp->elts[2].symbol,
-                                       tloc->gdbarch,
+                                       target_gdbarch (),
                                        frame_reg,
                                        frame_offset,
                                        tloc->address,
@@ -1651,9 +1652,7 @@ encode_actions_and_make_cleanup (struct bp_location *tloc,
                                 struct collection_list *tracepoint_list,
                                 struct collection_list *stepping_list)
 {
-  char *default_collect_line = NULL;
   struct command_line *actions;
-  struct command_line *default_collect_action = NULL;
   int frame_reg;
   LONGEST frame_offset;
   struct cleanup *back_to, *return_chain;
@@ -1790,9 +1789,6 @@ start_tracing (char *notes)
 
   for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, b); ix++)
     {
-      struct tracepoint *t = (struct tracepoint *) b;
-      struct bp_location *loc;
-
       if (b->enable_state == bp_enabled)
        any_enabled = 1;
 
@@ -3065,11 +3061,9 @@ trace_dump_command (char *args, int from_tty)
   printf_filtered ("Data collected at tracepoint %d, trace frame %d:\n",
                   tracepoint_number, traceframe_number);
 
-  old_chain = make_cleanup (null_cleanup, NULL);
-
   /* This command only makes sense for the current frame, not the
      selected frame.  */
-  make_cleanup_restore_current_thread ();
+  old_chain = make_cleanup_restore_current_thread ();
   select_frame (get_current_frame ());
 
   actions = all_tracepoint_actions_and_cleanup (loc->owner);
@@ -3963,7 +3957,6 @@ static void
 print_one_static_tracepoint_marker (int count,
                                    struct static_tracepoint_marker *marker)
 {
-  struct command_line *l;
   struct symbol *sym;
 
   char wrap_indent[80];
@@ -4330,8 +4323,8 @@ traceframe_available_memory (VEC(mem_range_s) **result,
 
            nr = VEC_safe_push (mem_range_s, *result, NULL);
 
-           nr->start = max (lo1, lo2);
-           nr->length = min (hi1, hi2) - nr->start;
+           nr->start = std::max (lo1, lo2);
+           nr->length = std::min (hi1, hi2) - nr->start;
          }
 
       normalize_mem_ranges (*result);
This page took 0.030307 seconds and 4 git commands to generate.