[binutils-gdb] gdb/riscv: fix creating breakpoints at invalid addresses
Andrew Burgess
aburgess@sourceware.org
Thu Mar 25 11:10:25 GMT 2021
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d3cbca38dfdd29d919a74d72d7c4608864c68f63
commit d3cbca38dfdd29d919a74d72d7c4608864c68f63
Author: Changbin Du <changbin.du@gmail.com>
Date: Thu Mar 25 11:02:23 2021 +0000
gdb/riscv: fix creating breakpoints at invalid addresses
To allow breakpoints to be created at invalid addresses,
target_read_code is used instead of read_code. This was fixed in
commit:
commit c01660c625766e848195285cc20581b9ed7ecfe2
Date: Wed Apr 17 00:31:43 2019 +0100
gdb/riscv: Allow breakpoints to be created at invalid addresses
Unfortunately, the call to read_code was left in by mistake. The
result is that GDB will fail when trying to create the breakpoint,
rather than when trying to install the breakpoint (as is the case with
other targets).
This commit fixes this mistake and removes the offending call to
read_code.
gdb/ChangeLog:
* riscv-tdep.c (riscv_breakpoint_kind_from_pc): Remove call to
read_code.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/riscv-tdep.c | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a548c58e8f7..0de5a9d1597 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-24 Changbin Du <changbin.du@gmail.com>
+
+ * riscv-tdep.c (riscv_breakpoint_kind_from_pc): Remove call to
+ read_code.
+
2021-03-24 Simon Marchi <simon.marchi@polymtl.ca>
* target.h (current_top_target): Remove, make callers use the
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index ca3efaf71cf..c1783996846 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -706,7 +706,6 @@ riscv_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
user. */
if (target_read_code (*pcptr, buf, 1) == -1)
buf[0] = 0;
- read_code (*pcptr, buf, 1);
}
if (riscv_debug_breakpoints)
More information about the Gdb-cvs
mailing list