This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix inconsistent breakpoint kinds between breakpoints and tracepoints in GDBServer.


This patch fixes a regression introduced by :
https://sourceware.org/ml/gdb-patches/2015-10/msg00369.html

Tests : gdb.trace/trace-break.exp and gdb.trace/trace-mt.exp would fail on x86
with gdbserver-{native,extended}.

Before this patch, the breakpoint kind set by GDB with a Z packet and the one
set in the case of a tracepoint would be inconsistent on targets that did not
implement breakpoint_kind_from_pc. On x86 for example a breakpoint set by GDB
would have a kind of 1 but a breakpoint set by a tracepoint would have a kind of
0.

This created a missmatch when trying to insert a tracepoint and a breakpoint at
the same location. One of the two breakpoints would be removed with debug
message : "Inconsistent breakpoint kind".

This patch fixes the issue by removing the default 0 breakpoint kind and
implementing all the targets breakpoint_kind_from_pc functions on linux.

The default breakpoint kind must be the breakpoint length to keep consistency
between breakpoints set via GDB and the ones set internally by GDBServer.

No regression on Ubuntu 14.04 x86-64 with gdbserver-{native-extended}

Compilation was tested on: aarch64,bfin,cris,crisv32,m32r,m68k,mips,nios2,ppc,
s390,sparc,tic6x,tile,x86,xtensa.

Not tested: sh

gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c (aarch64_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-bfin-low.c (bfin_breakpoint_kind_from_pc) New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-cris-low.c (cris_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-crisv32-low.c (cris_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-low.c (linux_breakpoint_kind_from_pc): Remove default return
	value.
	* linux-m32r-low.c (m32r_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-m68k-low.c (m68k_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-mips-low.c (mips_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-nios2-low.c (nios2_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-ppc-low.c (ppc_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-s390-low.c (s390_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-sh-low.c (sh_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-sparc-low.c (sparc_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-tic6x-low.c (tic6x_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-tile-low.c (tile_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-x86-low.c (x86_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
	* linux-xtensa-low.c (xtensa_breakpoint_kind_from_pc): New function.
	(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
---
 gdb/gdbserver/linux-aarch64-low.c | 10 +++++++++-
 gdb/gdbserver/linux-bfin-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-cris-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-crisv32-low.c | 10 +++++++++-
 gdb/gdbserver/linux-low.c         |  8 +++-----
 gdb/gdbserver/linux-m32r-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-m68k-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-mips-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-nios2-low.c   | 10 +++++++++-
 gdb/gdbserver/linux-ppc-low.c     | 10 +++++++++-
 gdb/gdbserver/linux-s390-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-sh-low.c      | 10 +++++++++-
 gdb/gdbserver/linux-sparc-low.c   | 10 +++++++++-
 gdb/gdbserver/linux-tic6x-low.c   | 10 +++++++++-
 gdb/gdbserver/linux-tile-low.c    | 10 +++++++++-
 gdb/gdbserver/linux-x86-low.c     | 11 ++++++++++-
 gdb/gdbserver/linux-xtensa-low.c  | 10 +++++++++-
 17 files changed, 148 insertions(+), 21 deletions(-)

diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index cb49a04..fc6757e 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -2931,6 +2931,14 @@ aarch64_supports_range_stepping (void)
   return 1;
 }
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+aarch64_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return aarch64_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -2949,7 +2957,7 @@ struct linux_target_ops the_low_target =
   NULL, /* fetch_register */
   aarch64_get_pc,
   aarch64_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  aarch64_breakpoint_kind_from_pc,
   aarch64_sw_breakpoint_from_kind,
   NULL, /* breakpoint_reinsert_addr */
   0,    /* decr_pc_after_break */
diff --git a/gdb/gdbserver/linux-bfin-low.c b/gdb/gdbserver/linux-bfin-low.c
index d3b83fc..e48674f 100644
--- a/gdb/gdbserver/linux-bfin-low.c
+++ b/gdb/gdbserver/linux-bfin-low.c
@@ -75,6 +75,14 @@ bfin_set_pc (struct regcache *regcache, CORE_ADDR pc)
 #define bfin_breakpoint_len 2
 static const gdb_byte bfin_breakpoint[bfin_breakpoint_len] = {0xa1, 0x00};
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+bfin_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return bfin_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -131,7 +139,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   bfin_get_pc,
   bfin_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  bfin_breakpoint_kind_from_pc,
   bfin_sw_breakpoint_from_kind,
   NULL, /* breakpoint_reinsert_addr */
   2,
diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c
index d7b70e3..4754ea3 100644
--- a/gdb/gdbserver/linux-cris-low.c
+++ b/gdb/gdbserver/linux-cris-low.c
@@ -81,6 +81,14 @@ cris_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned short cris_breakpoint = 0xe938;
 #define cris_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+cris_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return cris_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -149,7 +157,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   cris_get_pc,
   cris_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  cris_breakpoint_kind_from_pc,
   cris_sw_breakpoint_from_kind,
   cris_reinsert_addr,
   0,
diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c
index f97122e..0c59181 100644
--- a/gdb/gdbserver/linux-crisv32-low.c
+++ b/gdb/gdbserver/linux-crisv32-low.c
@@ -77,6 +77,14 @@ cris_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned short cris_breakpoint = 0xe938;
 #define cris_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+cris_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return cris_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -429,7 +437,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   cris_get_pc,
   cris_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  cris_breakpoint_kind_from_pc,
   cris_sw_breakpoint_from_kind,
   cris_reinsert_addr,
   0,
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index c20e257..ec568a9 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -6942,11 +6942,9 @@ current_lwp_ptid (void)
 static int
 linux_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
 {
-  if (the_low_target.breakpoint_kind_from_pc != NULL)
-    return (*the_low_target.breakpoint_kind_from_pc) (pcptr);
-  else
-    /* Default breakpoint kind value.  */
-    return 0;
+  gdb_assert (the_low_target.breakpoint_kind_from_pc != NULL);
+
+  return (*the_low_target.breakpoint_kind_from_pc) (pcptr);
 }
 
 /* Implementation of the target_ops method "sw_breakpoint_from_kind".  */
diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c
index bb1002f..269fc09 100644
--- a/gdb/gdbserver/linux-m32r-low.c
+++ b/gdb/gdbserver/linux-m32r-low.c
@@ -73,6 +73,14 @@ m32r_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned short m32r_breakpoint = 0x10f1;
 #define m32r_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+m32r_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return m32r_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -129,7 +137,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   m32r_get_pc,
   m32r_set_pc,
-  NULL, /* breakpoint_from_pc */
+  m32r_breakpoint_kind_from_pc,
   m32r_sw_breakpoint_from_kind,
   NULL,
   0,
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index ba8e5e9..2f65414 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -125,6 +125,14 @@ static struct regset_info m68k_regsets[] = {
 static const gdb_byte m68k_breakpoint[] = { 0x4E, 0x4F };
 #define m68k_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+m68k_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return m68k_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -224,7 +232,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   m68k_get_pc,
   m68k_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  m68k_breakpoint_kind_from_pc,
   m68k_sw_breakpoint_from_kind,
   NULL,
   2,
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 344d7a5..964c90f 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -266,6 +266,14 @@ mips_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned int mips_breakpoint = 0x0005000d;
 #define mips_breakpoint_len 4
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+mips_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return mips_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -890,7 +898,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   mips_get_pc,
   mips_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  mips_breakpoint_kind_from_pc,
   mips_sw_breakpoint_from_kind,
   mips_reinsert_addr,
   0,
diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c
index 95a2d9e..25b5da3 100644
--- a/gdb/gdbserver/linux-nios2-low.c
+++ b/gdb/gdbserver/linux-nios2-low.c
@@ -135,6 +135,14 @@ nios2_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned int nios2_breakpoint = NIOS2_BREAKPOINT;
 #define nios2_breakpoint_len 4
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+nios2_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return nios2_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -277,7 +285,7 @@ struct linux_target_ops the_low_target =
   NULL,
   nios2_get_pc,
   nios2_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  nios2_breakpoint_kind_from_pc,
   nios2_sw_breakpoint_from_kind,
   nios2_reinsert_addr,
   0,
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 6e6a936..b114d0c 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -486,6 +486,14 @@ ppc_arch_setup (void)
 static const unsigned int ppc_breakpoint = 0x7d821008;
 #define ppc_breakpoint_len 4
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+ppc_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return ppc_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -694,7 +702,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   ppc_get_pc,
   ppc_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  ppc_breakpoint_kind_from_pc,
   ppc_sw_breakpoint_from_kind,
   NULL,
   0,
diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c
index 2ba1221..1172f22 100644
--- a/gdb/gdbserver/linux-s390-low.c
+++ b/gdb/gdbserver/linux-s390-low.c
@@ -397,6 +397,14 @@ static struct regset_info s390_regsets[] = {
 static const gdb_byte s390_breakpoint[] = { 0, 1 };
 #define s390_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+s390_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return s390_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -674,7 +682,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   s390_get_pc,
   s390_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  s390_breakpoint_kind_from_pc,
   s390_sw_breakpoint_from_kind,
   NULL,
   s390_breakpoint_len,
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index f7f3239..948738d 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -77,6 +77,14 @@ sh_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static const unsigned short sh_breakpoint = 0xc3c3;
 #define sh_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+sh_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return sh_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -157,7 +165,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   sh_get_pc,
   sh_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  sh_breakpoint_kind_from_pc,
   sh_sw_breakpoint_from_kind,
   NULL,
   0,
diff --git a/gdb/gdbserver/linux-sparc-low.c b/gdb/gdbserver/linux-sparc-low.c
index 0691867..e320651 100644
--- a/gdb/gdbserver/linux-sparc-low.c
+++ b/gdb/gdbserver/linux-sparc-low.c
@@ -240,6 +240,14 @@ static const gdb_byte sparc_breakpoint[INSN_SIZE] = {
 };
 #define sparc_breakpoint_len INSN_SIZE
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+sparc_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return sparc_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const unsigned char *
@@ -331,7 +339,7 @@ struct linux_target_ops the_low_target = {
   sparc_get_pc,
   /* No sparc_set_pc is needed.  */
   NULL,
-  NULL, /* breakpoint_kind_from_pc */
+  sparc_breakpoint_kind_from_pc,
   sparc_sw_breakpoint_from_kind,
   sparc_reinsert_addr,
   0,
diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c
index d9476fd..e662eca 100644
--- a/gdb/gdbserver/linux-tic6x-low.c
+++ b/gdb/gdbserver/linux-tic6x-low.c
@@ -173,6 +173,14 @@ static int *tic6x_regmap;
 static unsigned int tic6x_breakpoint;
 #define tic6x_breakpoint_len 4
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+tic6x_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return tic6x_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -375,7 +383,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   tic6x_get_pc,
   tic6x_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  tic6x_breakpoint_kind_from_pc,
   tic6x_sw_breakpoint_from_kind,
   NULL,
   0,
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index e31a620..c93b07c 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -88,6 +88,14 @@ tile_set_pc (struct regcache *regcache, CORE_ADDR pc)
 static uint64_t tile_breakpoint = 0x400b3cae70166000ULL;
 #define tile_breakpoint_len 8
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+tile_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return tile_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -191,7 +199,7 @@ struct linux_target_ops the_low_target =
   NULL,
   tile_get_pc,
   tile_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  tile_breakpoint_kind_from_pc,
   tile_sw_breakpoint_from_kind,
   NULL,
   0,
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 406d552..22bd5b0 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -3243,6 +3243,15 @@ x86_emit_ops (void)
     return &i386_emit_ops;
 }
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+x86_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return x86_breakpoint_len;
+}
+
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -3270,7 +3279,7 @@ struct linux_target_ops the_low_target =
   NULL, /* fetch_register */
   x86_get_pc,
   x86_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  x86_breakpoint_kind_from_pc,
   x86_sw_breakpoint_from_kind,
   NULL,
   1,
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
index fa6f418..17813b1 100644
--- a/gdb/gdbserver/linux-xtensa-low.c
+++ b/gdb/gdbserver/linux-xtensa-low.c
@@ -154,6 +154,14 @@ static struct regset_info xtensa_regsets[] = {
 static const gdb_byte xtensa_breakpoint[] = XTENSA_BREAKPOINT;
 #define xtensa_breakpoint_len 2
 
+/* Implementation of linux_target_ops method "breakpoint_kind_from_pc".  */
+
+static int
+xtensa_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+{
+  return xtensa_breakpoint_len;
+}
+
 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
 
 static const gdb_byte *
@@ -243,7 +251,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* fetch_register */
   xtensa_get_pc,
   xtensa_set_pc,
-  NULL, /* breakpoint_kind_from_pc */
+  xtensa_breakpoint_kind_from_pc,
   xtensa_sw_breakpoint_from_kind,
   NULL,
   0,
-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]