This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] [spu] throw error when target_read_memory fails
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 18 Mar 2016 14:39:43 -0000
- Subject: [binutils-gdb] [spu] throw error when target_read_memory fails
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=941319d15194580a047484a53f232d374dc2d712
commit 941319d15194580a047484a53f232d374dc2d712
Author: Yao Qi <yao.qi@linaro.org>
Date: Fri Mar 18 14:39:09 2016 +0000
[spu] throw error when target_read_memory fails
I happen to see that 1 is returned in spu_software_single_step when
target_read_memory returns 1. It must be wrong. That patch changes
it to throwing an error. Note that I choose to throw error because I
find the code in the end of spu_software_single_step throws errors.
gdb:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* spu-tdep.c (spu_software_single_step): Throw error when
target_read_memory fails.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/spu-tdep.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2df6ccd..c074568 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-18 Yao Qi <yao.qi@linaro.org>
+
+ * spu-tdep.c (spu_software_single_step): Throw error when
+ target_read_memory fails.
+
2016-03-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-thread-db.c (check_pid_namespace_match): Extend the message.
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index bf3b289..8dad5c3 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1632,7 +1632,9 @@ spu_software_single_step (struct frame_info *frame)
pc = get_frame_pc (frame);
if (target_read_memory (pc, buf, 4))
- return 1;
+ throw_error (MEMORY_ERROR, _("Could not read instruction at %s."),
+ paddress (gdbarch, pc));
+
insn = extract_unsigned_integer (buf, 4, byte_order);
/* Get local store limit. */