This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] [spu] throw error when target_read_memory fails
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: uweigand at de dot ibm dot com
- Date: Thu, 17 Mar 2016 09:49:47 +0000
- Subject: [PATCH] [spu] throw error when target_read_memory fails
- Authentication-results: sourceware.org; auth=none
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-17 Yao Qi <yao.qi@linaro.org>
* spu-tdep.c (spu_software_single_step): Throw error when
target_read_memory fails.
---
gdb/spu-tdep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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. */
--
1.9.1