btrace: add format argument to supports_btrace
[deliverable/binutils-gdb.git] / gdb / remote.c
index e971a29d51a32c0734fa850d53fa794e6808c7e0..61420ec96e5d1eebee49ea23a60b86e6937df79d 100644 (file)
@@ -11324,16 +11324,23 @@ struct btrace_target_info
 /* Check whether the target supports branch tracing.  */
 
 static int
-remote_supports_btrace (struct target_ops *self)
+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_Qbtrace_bts) != PACKET_ENABLE)
-    return 0;
   if (packet_support (PACKET_qXfer_btrace) != PACKET_ENABLE)
     return 0;
 
-  return 1;
+  switch (format)
+    {
+      case BTRACE_FORMAT_NONE:
+       return 0;
+
+      case BTRACE_FORMAT_BTS:
+       return (packet_support (PACKET_Qbtrace_bts) == PACKET_ENABLE);
+    }
+
+  internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
 }
 
 /* Enable branch tracing.  */
@@ -11419,7 +11426,7 @@ remote_teardown_btrace (struct target_ops *self,
 
 static enum btrace_error
 remote_read_btrace (struct target_ops *self,
-                   VEC (btrace_block_s) **btrace,
+                   struct btrace_data *btrace,
                    struct btrace_target_info *tinfo,
                    enum btrace_read_type type)
 {
@@ -11459,7 +11466,7 @@ remote_read_btrace (struct target_ops *self,
     return BTRACE_ERR_UNKNOWN;
 
   cleanup = make_cleanup (xfree, xml);
-  *btrace = parse_xml_btrace (xml);
+  parse_xml_btrace (btrace, xml);
   do_cleanups (cleanup);
 
   return BTRACE_ERR_NONE;
This page took 0.039879 seconds and 4 git commands to generate.