Merge branch 'master' into merge-job
authorJenkins as Icarus Sparry <icarus.sparry@amd.com>
Tue, 10 Dec 2019 04:08:17 +0000 (04:08 +0000)
committerJenkins as Icarus Sparry <icarus.sparry@amd.com>
Tue, 10 Dec 2019 04:08:17 +0000 (04:08 +0000)
1  2 
gdb/breakpoint.c

diff --combined gdb/breakpoint.c
index 98724f8de2871083d13366345e07107ee911fcb8,904abda8db18292496beaa68034fc89e9e90649a..0d23eb27cc100c7943f1d9219f77b9e34a399130
@@@ -1,7 -1,6 +1,7 @@@
  /* Everything about breakpoints, for GDB.
  
     Copyright (C) 1986-2019 Free Software Foundation, Inc.
 +   Copyright (C) 2019 Advanced Micro Devices, Inc. All rights reserved.
  
     This file is part of GDB.
  
@@@ -247,6 -246,9 +247,9 @@@ struct breakpoint_ops bkpt_breakpoint_o
  /* Breakpoints set on probes.  */
  static struct breakpoint_ops bkpt_probe_breakpoint_ops;
  
+ /* Tracepoints set on probes.  */
+ static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
  /* Dynamic printf class type.  */
  struct breakpoint_ops dprintf_breakpoint_ops;
  
@@@ -365,10 -367,7 +368,10 @@@ show_automatic_hardware_breakpoints (st
     breakpoints until the next resume, and removes them again when the
     target fully stops.  This is a bit safer in case GDB crashes while
     processing user input.  */
 -static bool always_inserted_mode = false;
 +/* FIXME: this is a temporary workaround to make sure waves created while
 +   all known threads are stopped, and the gdb prompt is presented, do not
 +   execute past the enabled breakpoints.  */
 +static bool always_inserted_mode = true;
  
  static void
  show_always_inserted_mode (struct ui_file *file, int from_tty,
@@@ -8510,9 -8509,7 +8513,9 @@@ static voi
  mention (struct breakpoint *b)
  {
    b->ops->print_mention (b);
 -  current_uiout->text ("\n");
 +  if (current_uiout->is_mi_like_p ())
 +    return;
 +  printf_filtered ("\n");
  }
  \f
  
@@@ -9169,6 -9166,41 +9172,41 @@@ decode_static_tracepoint_spec (const ch
    return sals;
  }
  
+ /* Returns the breakpoint ops appropriate for use with with LOCATION_TYPE and
+    according to IS_TRACEPOINT.  */
+ static const struct breakpoint_ops *
+ breakpoint_ops_for_event_location_type (enum event_location_type location_type,
+                                       bool is_tracepoint)
+ {
+   if (is_tracepoint)
+     {
+       if (location_type == PROBE_LOCATION)
+       return &tracepoint_probe_breakpoint_ops;
+       else
+       return &tracepoint_breakpoint_ops;
+     }
+   else
+     {
+       if (location_type == PROBE_LOCATION)
+       return &bkpt_probe_breakpoint_ops;
+       else
+       return &bkpt_breakpoint_ops;
+     }
+ }
+ /* See breakpoint.h.  */
+ const struct breakpoint_ops *
+ breakpoint_ops_for_event_location (const struct event_location *location,
+                                  bool is_tracepoint)
+ {
+   if (location != nullptr)
+     return breakpoint_ops_for_event_location_type
+       (event_location_type (location), is_tracepoint);
+   return is_tracepoint ? &tracepoint_breakpoint_ops : &bkpt_breakpoint_ops;
+ }
  /* See breakpoint.h.  */
  
  int
@@@ -9350,16 -9382,10 +9388,10 @@@ break_command_1 (const char *arg, int f
    enum bptype type_wanted = (flag & BP_HARDWAREFLAG
                             ? bp_hardware_breakpoint
                             : bp_breakpoint);
-   struct breakpoint_ops *ops;
  
    event_location_up location = string_to_event_location (&arg, current_language);
-   /* Matching breakpoints on probes.  */
-   if (location != NULL
-       && event_location_type (location.get ()) == PROBE_LOCATION)
-     ops = &bkpt_probe_breakpoint_ops;
-   else
-     ops = &bkpt_breakpoint_ops;
+   const struct breakpoint_ops *ops = breakpoint_ops_for_event_location
+     (location.get (), false /* is_tracepoint */);
  
    create_breakpoint (get_current_arch (),
                     location.get (),
@@@ -12808,8 -12834,7 +12840,7 @@@ tracepoint_decode_location (struct brea
  
  struct breakpoint_ops tracepoint_breakpoint_ops;
  
- /* The breakpoint_ops structure to be use on tracepoints placed in a
-    static probe.  */
+ /* Virtual table for tracepoints on static probes.  */
  
  static void
  tracepoint_probe_create_sals_from_location
@@@ -12830,8 -12855,6 +12861,6 @@@ tracepoint_probe_decode_location (struc
    return bkpt_probe_decode_location (b, location, search_pspace);
  }
  
- static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
  /* Dprintf breakpoint_ops methods.  */
  
  static void
@@@ -14473,15 -14496,10 +14502,10 @@@ set_tracepoint_count (int num
  static void
  trace_command (const char *arg, int from_tty)
  {
-   struct breakpoint_ops *ops;
    event_location_up location = string_to_event_location (&arg,
                                                         current_language);
-   if (location != NULL
-       && event_location_type (location.get ()) == PROBE_LOCATION)
-     ops = &tracepoint_probe_breakpoint_ops;
-   else
-     ops = &tracepoint_breakpoint_ops;
+   const struct breakpoint_ops *ops = breakpoint_ops_for_event_location
+     (location.get (), true /* is_tracepoint */);
  
    create_breakpoint (get_current_arch (),
                     location.get (),
This page took 0.034527 seconds and 4 git commands to generate.