powerpc: Support z-point type in gdbserver.
authorWei-cheng Wang <cole945@gmail.com>
Sat, 27 Jun 2015 16:21:39 +0000 (00:21 +0800)
committerMarcin Kościelnicki <koriakin@0x04.net>
Wed, 24 Feb 2016 17:38:42 +0000 (18:38 +0100)
Support z-point, so tracepoints and breakpoints can be inserted at the same
location.

gdb/gdbserver/ChangeLog:

2016-02-24  Wei-cheng Wang  <cole945@gmail.com>

* linux-ppc-low.c (ppc_supports_z_point_type): New function:
(ppc_insert_point, ppc_remove_point): Insert/remove z-packet breakpoints.
(ppc64_emit_ops_vector): Add target ops - ppc_supports_z_point_type,
ppc_insert_point, ppc_remove_point.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-ppc-low.c

index 326c7699c2143febc5b0596fe7241d43b00afa0c..8c4dab406c8fdfe6e61e5bbca135afeee0135193 100644 (file)
@@ -1,3 +1,10 @@
+2016-02-24  Wei-cheng Wang  <cole945@gmail.com>
+
+       * linux-ppc-low.c (ppc_supports_z_point_type): New function:
+       (ppc_insert_point, ppc_remove_point): Insert/remove z-packet breakpoints.
+       (ppc64_emit_ops_vector): Add target ops - ppc_supports_z_point_type,
+       ppc_insert_point, ppc_remove_point.
+
 2016-02-17  Marcin Kościelnicki  <koriakin@0x04.net>
 
        * linux-s390-low.c (s390_supports_z_point_type): New function.
index 2145c504dad6808881a6332ee142b7bedc1a137f..61a1693c4c77a6b9611ebae29dfac57b0ae965bd 100644 (file)
@@ -423,6 +423,69 @@ ppc_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
+/* Implement supports_z_point_type target-ops.
+   Returns true if type Z_TYPE breakpoint is supported.
+
+   Handling software breakpoint at server side, so tracepoints
+   and breakpoints can be inserted at the same location.  */
+
+static int
+ppc_supports_z_point_type (char z_type)
+{
+  switch (z_type)
+    {
+    case Z_PACKET_SW_BP:
+      return 1;
+    case Z_PACKET_HW_BP:
+    case Z_PACKET_WRITE_WP:
+    case Z_PACKET_ACCESS_WP:
+    default:
+      return 0;
+    }
+}
+
+/* Implement insert_point target-ops.
+   Returns 0 on success, -1 on failure and 1 on unsupported.  */
+
+static int
+ppc_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
+                 int size, struct raw_breakpoint *bp)
+{
+  switch (type)
+    {
+    case raw_bkpt_type_sw:
+      return insert_memory_breakpoint (bp);
+
+    case raw_bkpt_type_hw:
+    case raw_bkpt_type_write_wp:
+    case raw_bkpt_type_access_wp:
+    default:
+      /* Unsupported.  */
+      return 1;
+    }
+}
+
+/* Implement remove_point target-ops.
+   Returns 0 on success, -1 on failure and 1 on unsupported.  */
+
+static int
+ppc_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
+                 int size, struct raw_breakpoint *bp)
+{
+  switch (type)
+    {
+    case raw_bkpt_type_sw:
+      return remove_memory_breakpoint (bp);
+
+    case raw_bkpt_type_hw:
+    case raw_bkpt_type_write_wp:
+    case raw_bkpt_type_access_wp:
+    default:
+      /* Unsupported.  */
+      return 1;
+    }
+}
+
 /* Provide only a fill function for the general register set.  ps_lgetregs
    will use this for NPTL support.  */
 
@@ -706,9 +769,9 @@ struct linux_target_ops the_low_target = {
   NULL,
   0,
   ppc_breakpoint_at,
-  NULL, /* supports_z_point_type */
-  NULL,
-  NULL,
+  ppc_supports_z_point_type,
+  ppc_insert_point,
+  ppc_remove_point,
   NULL,
   NULL,
   ppc_collect_ptrace_register,
This page took 0.032607 seconds and 4 git commands to generate.