btrace, gdbserver: remove the to_supports_btrace target method
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 19 Jan 2018 13:32:09 +0000 (14:32 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 9 Feb 2018 13:03:20 +0000 (14:03 +0100)
Remove the to_supports_btrace target method and instead rely on detecting errors
when trying to enable recording.  This will also provide a suitable error
message explaining why recording is not possible.

For remote debugging, gdbserver will now always advertise branch tracing related
packets.  When talking to an older GDB, this will cause GDB to try to enable
branch tracing and gdbserver to report a suitable error message every time.

An older gdbserver will not advertise branch tracing related packets if the
one-time check failed, so a newer GDB with this patch will fail to enable branch
tracing at remote_enable_btrace() rather than at btrace_enable().  The error
message is the same in both cases so there should be no user-visible change.

gdb/
* btrace.c (btrace_enable): Remove target_supports_btrace call.
* nat/linux-btrace.c (perf_event_pt_event_type): Move.
(kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
(linux_supports_pt, linux_supports_btrace): Remove.
(linux_enable_bts): Call cpu_supports_bts.
* nat/linux-btrace.h (linux_supports_btrace): Remove.
* remote.c (remote_supports_btrace): Remove.
(init_remote_ops): Remove remote_supports_btrace.
* target-delegates.c: Regenerated.
* target.c (target_supports_btrace): Remove.
* target.h (target_ops) <to_supports_btrace>: Remove
(target_supports_btrace): Remove.
* x86-linux-nat.c (x86_linux_create_target): Remove
linux_supports_btrace.

gdbserver/
* linux-low.c (linux_target_ops): Remove linux_supports_btrace.
* nto-low.c (nto_target_ops): Remove NULL for supports_btrace.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
* server.c (supported_btrace_packets): Report packets unconditionally.
* target.h (target_ops) <supports_btrace>: Remove.
(target_supports_btrace): Remove.

16 files changed:
gdb/ChangeLog
gdb/btrace.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/nto-low.c
gdb/gdbserver/server.c
gdb/gdbserver/spu-low.c
gdb/gdbserver/target.h
gdb/gdbserver/win32-low.c
gdb/nat/linux-btrace.c
gdb/nat/linux-btrace.h
gdb/remote.c
gdb/target-delegates.c
gdb/target.c
gdb/target.h
gdb/x86-linux-nat.c

index 3ff2ccf7c5c3c27fa2df8541bfc8d9dd110fb167..df0283a8e2e3f0576c7908a2df3bd9ee7b64dbbc 100644 (file)
@@ -1,3 +1,20 @@
+2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * btrace.c (btrace_enable): Remove target_supports_btrace call.
+       * nat/linux-btrace.c (perf_event_pt_event_type): Move.
+       (kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
+       (linux_supports_pt, linux_supports_btrace): Remove.
+       (linux_enable_bts): Call cpu_supports_bts.
+       * nat/linux-btrace.h (linux_supports_btrace): Remove.
+       * remote.c (remote_supports_btrace): Remove.
+       (init_remote_ops): Remove remote_supports_btrace.
+       * target-delegates.c: Regenerated.
+       * target.c (target_supports_btrace): Remove.
+       * target.h (target_ops) <to_supports_btrace>: Remove
+       (target_supports_btrace): Remove.
+       * x86-linux-nat.c (x86_linux_create_target): Remove
+       linux_supports_btrace.
+
 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
 
        * nat/linux-btrace.c (linux_enable_btrace): Throw exception if enabling
index ffcf53ad9f11ce2d2306c32a1edc205aecf4cbcf..2b031a4b6d0bd3e1e4e6d6a0836cec9b007ee654 100644 (file)
@@ -1582,9 +1582,6 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
     error (_("GDB does not support Intel Processor Trace."));
 #endif /* !defined (HAVE_LIBIPT) */
 
-  if (!target_supports_btrace (conf->format))
-    error (_("Target does not support branch tracing."));
-
   DEBUG ("enable thread %s (%s)", print_thread_id (tp),
         target_pid_to_str (tp->ptid));
 
index 1b8d6f6276c66f5b139f07337415d99fd4e4ad4f..0ff5af79f0acc959449e5005a316a10e20e9fb71 100644 (file)
@@ -1,3 +1,13 @@
+2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * linux-low.c (linux_target_ops): Remove linux_supports_btrace.
+       * nto-low.c (nto_target_ops): Remove NULL for supports_btrace.
+       * spu-low.c (spu_target_ops): Likewise.
+       * win32-low.c (win32_target_ops): Likewise.
+       * server.c (supported_btrace_packets): Report packets unconditionally.
+       * target.h (target_ops) <supports_btrace>: Remove.
+       (target_supports_btrace): Remove.
+
 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
 
        * server.c (handle_btrace_enable_bts, handle_btrace_enable_pt)
index b6b660ea9608357cc7565c98177b3cd28d5e6472..00385ce4c91cee9cc020430ec928d6fde0ecd6b8 100644 (file)
@@ -7531,7 +7531,6 @@ static struct target_ops linux_target_ops = {
   linux_qxfer_libraries_svr4,
   linux_supports_agent,
 #ifdef HAVE_LINUX_BTRACE
-  linux_supports_btrace,
   linux_enable_btrace,
   linux_low_disable_btrace,
   linux_low_read_btrace,
@@ -7541,7 +7540,6 @@ static struct target_ops linux_target_ops = {
   NULL,
   NULL,
   NULL,
-  NULL,
 #endif
   linux_supports_range_stepping,
   linux_proc_pid_to_exec_file,
index a570ca9991c8d43c13623b0757dc287db8665938..b68b8111592c667a78d98038335905c45c5f5d9c 100644 (file)
@@ -991,7 +991,6 @@ static struct target_ops nto_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
index 5ce62810bf6d80a7bee43ab055013c859a583b27..cb02b5850765b469c48b5704e20b0c277d81bfef 100644 (file)
@@ -2104,27 +2104,10 @@ crc32 (CORE_ADDR base, int len, unsigned int crc)
 static void
 supported_btrace_packets (char *buf)
 {
-  int btrace_supported = 0;
-
-  if (target_supports_btrace (BTRACE_FORMAT_BTS))
-    {
-      strcat (buf, ";Qbtrace:bts+");
-      strcat (buf, ";Qbtrace-conf:bts:size+");
-
-      btrace_supported = 1;
-    }
-
-  if (target_supports_btrace (BTRACE_FORMAT_PT))
-    {
-      strcat (buf, ";Qbtrace:pt+");
-      strcat (buf, ";Qbtrace-conf:pt:size+");
-
-      btrace_supported = 1;
-    }
-
-  if (!btrace_supported)
-    return;
-
+  strcat (buf, ";Qbtrace:bts+");
+  strcat (buf, ";Qbtrace-conf:bts:size+");
+  strcat (buf, ";Qbtrace:pt+");
+  strcat (buf, ";Qbtrace-conf:pt:size+");
   strcat (buf, ";Qbtrace:off+");
   strcat (buf, ";qXfer:btrace:read+");
   strcat (buf, ";qXfer:btrace-conf:read+");
index fd1f8d652c602a81616a70f90c97e4deddc83514..5b880d2a42fd71658578f3f1387e8bb334e94997 100644 (file)
@@ -717,7 +717,6 @@ static struct target_ops spu_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
index 295e64d7cbc135acdacc162417c80c276f340186..dcefe1a94b72c3121d33411c1a2e85dbc6666094 100644 (file)
@@ -391,9 +391,6 @@ struct target_ops
   /* Return true if target supports debugging agent.  */
   int (*supports_agent) (void);
 
-  /* Check whether the target supports branch tracing.  */
-  int (*supports_btrace) (struct target_ops *, enum btrace_format);
-
   /* Enable branch tracing for PTID based on CONF and allocate a branch trace
      target information struct for reading and for disabling branch trace.  */
   struct btrace_target_info *(*enable_btrace)
@@ -623,10 +620,6 @@ int kill_inferior (int);
   (the_target->supports_agent ? \
    (*the_target->supports_agent) () : 0)
 
-#define target_supports_btrace(format)                 \
-  (the_target->supports_btrace                         \
-   ? (*the_target->supports_btrace) (the_target, format) : 0)
-
 #define target_enable_btrace(ptid, conf) \
   (*the_target->enable_btrace) (ptid, conf)
 
index b1d9b51e533cc16b5ef96838f466ed1a75e17ea3..9f0c4e46c1ffcf9d9d5e444d538435a046b1e59c 100644 (file)
@@ -1842,7 +1842,6 @@ static struct target_ops win32_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
index 2b37e419ce769e429a3fdae36403fc9f2d66bdf9..42f56f9ed30a2dfa4b8a72a87fa93d9d411670b3 100644 (file)
@@ -175,23 +175,6 @@ perf_event_read_all (struct perf_event_buffer *pev, gdb_byte **data,
   pev->last_head = data_head;
 }
 
-/* Determine the event type.
-   Returns zero on success and fills in TYPE; returns -1 otherwise.  */
-
-static int
-perf_event_pt_event_type (int *type)
-{
-  gdb_file_up file
-    =  gdb_fopen_cloexec ("/sys/bus/event_source/devices/intel_pt/type", "r");
-  if (file == nullptr)
-    return -1;
-
-  int found = fscanf (file.get (), "%d", type);
-  if (found == 1)
-    return 0;
-  return -1;
-}
-
 /* Try to determine the start address of the Linux kernel.  */
 
 static uint64_t
@@ -376,176 +359,6 @@ perf_event_read_bts (struct btrace_target_info* tinfo, const uint8_t *begin,
   return btrace;
 }
 
-/* Check whether the kernel supports BTS.  */
-
-static int
-kernel_supports_bts (void)
-{
-  struct perf_event_attr attr;
-  pid_t child, pid;
-  int status, file;
-
-  errno = 0;
-  child = fork ();
-  switch (child)
-    {
-    case -1:
-      warning (_("test bts: cannot fork: %s."), safe_strerror (errno));
-      return 0;
-
-    case 0:
-      status = ptrace (PTRACE_TRACEME, 0, NULL, NULL);
-      if (status != 0)
-       {
-         warning (_("test bts: cannot PTRACE_TRACEME: %s."),
-                  safe_strerror (errno));
-         _exit (1);
-       }
-
-      status = raise (SIGTRAP);
-      if (status != 0)
-       {
-         warning (_("test bts: cannot raise SIGTRAP: %s."),
-                  safe_strerror (errno));
-         _exit (1);
-       }
-
-      _exit (1);
-
-    default:
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-       {
-         warning (_("test bts: bad pid %ld, error: %s."),
-                  (long) pid, safe_strerror (errno));
-         return 0;
-       }
-
-      if (!WIFSTOPPED (status))
-       {
-         warning (_("test bts: expected stop. status: %d."),
-                  status);
-         return 0;
-       }
-
-      memset (&attr, 0, sizeof (attr));
-
-      attr.type = PERF_TYPE_HARDWARE;
-      attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
-      attr.sample_period = 1;
-      attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_ADDR;
-      attr.exclude_kernel = 1;
-      attr.exclude_hv = 1;
-      attr.exclude_idle = 1;
-
-      file = syscall (SYS_perf_event_open, &attr, child, -1, -1, 0);
-      if (file >= 0)
-       close (file);
-
-      kill (child, SIGKILL);
-      ptrace (PTRACE_KILL, child, NULL, NULL);
-
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-       {
-         warning (_("test bts: bad pid %ld, error: %s."),
-                  (long) pid, safe_strerror (errno));
-         if (!WIFSIGNALED (status))
-           warning (_("test bts: expected killed. status: %d."),
-                    status);
-       }
-
-      return (file >= 0);
-    }
-}
-
-/* Check whether the kernel supports Intel Processor Trace.  */
-
-static int
-kernel_supports_pt (void)
-{
-  struct perf_event_attr attr;
-  pid_t child, pid;
-  int status, file, type;
-
-  errno = 0;
-  child = fork ();
-  switch (child)
-    {
-    case -1:
-      warning (_("test pt: cannot fork: %s."), safe_strerror (errno));
-      return 0;
-
-    case 0:
-      status = ptrace (PTRACE_TRACEME, 0, NULL, NULL);
-      if (status != 0)
-       {
-         warning (_("test pt: cannot PTRACE_TRACEME: %s."),
-                  safe_strerror (errno));
-         _exit (1);
-       }
-
-      status = raise (SIGTRAP);
-      if (status != 0)
-       {
-         warning (_("test pt: cannot raise SIGTRAP: %s."),
-                  safe_strerror (errno));
-         _exit (1);
-       }
-
-      _exit (1);
-
-    default:
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-       {
-         warning (_("test pt: bad pid %ld, error: %s."),
-                  (long) pid, safe_strerror (errno));
-         return 0;
-       }
-
-      if (!WIFSTOPPED (status))
-       {
-         warning (_("test pt: expected stop. status: %d."),
-                  status);
-         return 0;
-       }
-
-      status = perf_event_pt_event_type (&type);
-      if (status != 0)
-       file = -1;
-      else
-       {
-         memset (&attr, 0, sizeof (attr));
-
-         attr.size = sizeof (attr);
-         attr.type = type;
-         attr.exclude_kernel = 1;
-         attr.exclude_hv = 1;
-         attr.exclude_idle = 1;
-
-         file = syscall (SYS_perf_event_open, &attr, child, -1, -1, 0);
-         if (file >= 0)
-           close (file);
-       }
-
-      kill (child, SIGKILL);
-      ptrace (PTRACE_KILL, child, NULL, NULL);
-
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-       {
-         warning (_("test pt: bad pid %ld, error: %s."),
-                  (long) pid, safe_strerror (errno));
-         if (!WIFSIGNALED (status))
-           warning (_("test pt: expected killed. status: %d."),
-                    status);
-       }
-
-      return (file >= 0);
-    }
-}
-
 /* Check whether an Intel cpu supports BTS.  */
 
 static int
@@ -596,64 +409,6 @@ cpu_supports_bts (void)
     }
 }
 
-/* Check whether the linux target supports BTS.  */
-
-static int
-linux_supports_bts (void)
-{
-  static int cached;
-
-  if (cached == 0)
-    {
-      if (!kernel_supports_bts ())
-       cached = -1;
-      else if (!cpu_supports_bts ())
-       cached = -1;
-      else
-       cached = 1;
-    }
-
-  return cached > 0;
-}
-
-/* Check whether the linux target supports Intel Processor Trace.  */
-
-static int
-linux_supports_pt (void)
-{
-  static int cached;
-
-  if (cached == 0)
-    {
-      if (!kernel_supports_pt ())
-       cached = -1;
-      else
-       cached = 1;
-    }
-
-  return cached > 0;
-}
-
-/* See linux-btrace.h.  */
-
-int
-linux_supports_btrace (struct target_ops *ops, enum btrace_format format)
-{
-  switch (format)
-    {
-    case BTRACE_FORMAT_NONE:
-      return 0;
-
-    case BTRACE_FORMAT_BTS:
-      return linux_supports_bts ();
-
-    case BTRACE_FORMAT_PT:
-      return linux_supports_pt ();
-    }
-
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
-}
-
 /* Enable branch tracing in BTS format.  */
 
 static struct btrace_target_info *
@@ -664,6 +419,9 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
   __u64 data_offset;
   int pid, pg;
 
+  if (!cpu_supports_bts ())
+    error (_("BTS support has been disabled for the target cpu."));
+
   gdb::unique_xmalloc_ptr<btrace_target_info> tinfo
     (XCNEW (btrace_target_info));
   tinfo->ptid = ptid;
@@ -770,6 +528,23 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
 
 #if defined (PERF_ATTR_SIZE_VER5)
 
+/* Determine the event type.
+   Returns zero on success and fills in TYPE; returns -1 otherwise.  */
+
+static int
+perf_event_pt_event_type (int *type)
+{
+  gdb_file_up file =
+    gdb_fopen_cloexec ("/sys/bus/event_source/devices/intel_pt/type", "r");
+  if (file.get () == nullptr)
+    return -1;
+
+  int found = fscanf (file.get (), "%d", type);
+  if (found == 1)
+    return 0;
+  return -1;
+}
+
 /* Enable branch tracing in Intel Processor Trace format.  */
 
 static struct btrace_target_info *
@@ -1146,14 +921,6 @@ linux_btrace_conf (const struct btrace_target_info *tinfo)
 
 /* See linux-btrace.h.  */
 
-int
-linux_supports_btrace (struct target_ops *ops, enum btrace_format format)
-{
-  return 0;
-}
-
-/* See linux-btrace.h.  */
-
 struct btrace_target_info *
 linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
 {
index 31a8d9e67bdda9bcd92d0fe976e204600fb12b2a..118030190d2d7ffcc555965a59df84370251d20e 100644 (file)
@@ -103,9 +103,6 @@ struct btrace_target_info
 #endif /* HAVE_LINUX_PERF_EVENT_H */
 };
 
-/* See to_supports_btrace in target.h.  */
-extern int linux_supports_btrace (struct target_ops *, enum btrace_format);
-
 /* See to_enable_btrace in target.h.  */
 extern struct btrace_target_info *
   linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf);
index b320ee07c9e7ff831dfb68d08eb931f437cce7a6..e5680f023322d58d576d00e268cfeb7ab7c4eff9 100644 (file)
@@ -13095,37 +13095,6 @@ remote_btrace_reset (void)
   memset (&rs->btrace_config, 0, sizeof (rs->btrace_config));
 }
 
-/* Check whether the target supports branch tracing.  */
-
-static int
-remote_supports_btrace (struct target_ops *self, enum btrace_format format)
-{
-  if (packet_support (PACKET_Qbtrace_off) != PACKET_ENABLE)
-    return 0;
-  if (packet_support (PACKET_qXfer_btrace) != PACKET_ENABLE)
-    return 0;
-
-  switch (format)
-    {
-      case BTRACE_FORMAT_NONE:
-       return 0;
-
-      case BTRACE_FORMAT_BTS:
-       return (packet_support (PACKET_Qbtrace_bts) == PACKET_ENABLE);
-
-      case BTRACE_FORMAT_PT:
-       /* The trace is decoded on the host.  Even if our target supports it,
-          we still need to have libipt to decode the trace.  */
-#if defined (HAVE_LIBIPT)
-       return (packet_support (PACKET_Qbtrace_pt) == PACKET_ENABLE);
-#else /* !defined (HAVE_LIBIPT)  */
-       return 0;
-#endif /* !defined (HAVE_LIBIPT)  */
-    }
-
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
-}
-
 /* Synchronize the configuration with the target.  */
 
 static void
@@ -13649,7 +13618,6 @@ Specify the serial device it is connected to\n\
   remote_ops.to_traceframe_info = remote_traceframe_info;
   remote_ops.to_use_agent = remote_use_agent;
   remote_ops.to_can_use_agent = remote_can_use_agent;
-  remote_ops.to_supports_btrace = remote_supports_btrace;
   remote_ops.to_enable_btrace = remote_enable_btrace;
   remote_ops.to_disable_btrace = remote_disable_btrace;
   remote_ops.to_teardown_btrace = remote_teardown_btrace;
index 95ccef42df28ca5a3829a9ecbb21d606e67b2339..c7ebdbfb5b797d20b9ea569c6d86289c55f07d9b 100644 (file)
@@ -3458,35 +3458,6 @@ debug_can_use_agent (struct target_ops *self)
   return result;
 }
 
-static int
-delegate_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  self = self->beneath;
-  return self->to_supports_btrace (self, arg1);
-}
-
-static int
-tdefault_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  return 0;
-}
-
-static int
-debug_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  int result;
-  fprintf_unfiltered (gdb_stdlog, "-> %s->to_supports_btrace (...)\n", debug_target.to_shortname);
-  result = debug_target.to_supports_btrace (&debug_target, arg1);
-  fprintf_unfiltered (gdb_stdlog, "<- %s->to_supports_btrace (", debug_target.to_shortname);
-  target_debug_print_struct_target_ops_p (&debug_target);
-  fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_enum_btrace_format (arg1);
-  fputs_unfiltered (") = ", gdb_stdlog);
-  target_debug_print_int (result);
-  fputs_unfiltered ("\n", gdb_stdlog);
-  return result;
-}
-
 static struct btrace_target_info *
 delegate_enable_btrace (struct target_ops *self, ptid_t arg1, const struct btrace_config *arg2)
 {
@@ -4458,8 +4429,6 @@ install_delegators (struct target_ops *ops)
     ops->to_use_agent = delegate_use_agent;
   if (ops->to_can_use_agent == NULL)
     ops->to_can_use_agent = delegate_can_use_agent;
-  if (ops->to_supports_btrace == NULL)
-    ops->to_supports_btrace = delegate_supports_btrace;
   if (ops->to_enable_btrace == NULL)
     ops->to_enable_btrace = delegate_enable_btrace;
   if (ops->to_disable_btrace == NULL)
@@ -4647,7 +4616,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_traceframe_info = tdefault_traceframe_info;
   ops->to_use_agent = tdefault_use_agent;
   ops->to_can_use_agent = tdefault_can_use_agent;
-  ops->to_supports_btrace = tdefault_supports_btrace;
   ops->to_enable_btrace = tdefault_enable_btrace;
   ops->to_disable_btrace = tdefault_disable_btrace;
   ops->to_teardown_btrace = tdefault_teardown_btrace;
@@ -4808,7 +4776,6 @@ init_debug_target (struct target_ops *ops)
   ops->to_traceframe_info = debug_traceframe_info;
   ops->to_use_agent = debug_use_agent;
   ops->to_can_use_agent = debug_can_use_agent;
-  ops->to_supports_btrace = debug_supports_btrace;
   ops->to_enable_btrace = debug_enable_btrace;
   ops->to_disable_btrace = debug_disable_btrace;
   ops->to_teardown_btrace = debug_teardown_btrace;
index ea2ad3f00c1b7c38260e94d050ea4ffc7d5bce58..db7c09ba0f3b0ed3996cc8ecc79764eff6ddfdf8 100644 (file)
@@ -3645,14 +3645,6 @@ target_ranged_break_num_registers (void)
 
 /* See target.h.  */
 
-int
-target_supports_btrace (enum btrace_format format)
-{
-  return current_target.to_supports_btrace (&current_target, format);
-}
-
-/* See target.h.  */
-
 struct btrace_target_info *
 target_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
 {
index 096252aeaf252c3dfbb512171face488f2fb11cb..83cf48575fb51557a15b48db293f15f3b4429b58 100644 (file)
@@ -1110,10 +1110,6 @@ struct target_ops
     int (*to_can_use_agent) (struct target_ops *)
       TARGET_DEFAULT_RETURN (0);
 
-    /* Check whether the target supports branch tracing.  */
-    int (*to_supports_btrace) (struct target_ops *, enum btrace_format)
-      TARGET_DEFAULT_RETURN (0);
-
     /* Enable branch tracing for PTID using CONF configuration.
        Return a branch trace target information struct for reading and for
        disabling branch trace.  */
@@ -2428,9 +2424,6 @@ extern void update_target_permissions (void);
 \f
 /* Imported from machine dependent code.  */
 
-/* See to_supports_btrace in struct target_ops.  */
-extern int target_supports_btrace (enum btrace_format);
-
 /* See to_enable_btrace in struct target_ops.  */
 extern struct btrace_target_info *
   target_enable_btrace (ptid_t ptid, const struct btrace_config *);
index 75f68de9c2da88b1ac92c04b2a0672cae8c3d038..a3bdafffa29b67c7cb4f841b78d0c5f55e6062d6 100644 (file)
@@ -340,7 +340,6 @@ x86_linux_create_target (void)
   t->to_read_description = x86_linux_read_description;
 
   /* Add btrace methods.  */
-  t->to_supports_btrace = linux_supports_btrace;
   t->to_enable_btrace = x86_linux_enable_btrace;
   t->to_disable_btrace = x86_linux_disable_btrace;
   t->to_teardown_btrace = x86_linux_teardown_btrace;
This page took 0.043826 seconds and 4 git commands to generate.