aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/s390-linux-tdep.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index ae45ec6..1eaeff3 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -572,12 +572,21 @@ s390_linux_get_syscall_number (struct gdbarch *gdbarch,
don't currently support SVC via EXECUTE. */
regcache_cooked_read_unsigned (regs, tdep->pc_regnum, &pc);
pc -= 2;
- opcode = read_memory_unsigned_integer ((CORE_ADDR) pc, 1, byte_order);
+
+ ULONGEST val;
+ if (!safe_read_memory_unsigned_integer ((CORE_ADDR) pc, 1, byte_order,
+ &val))
+ return -1;
+ opcode = val;
+
if (opcode != op_svc)
return -1;
- svc_number = read_memory_unsigned_integer ((CORE_ADDR) pc + 1, 1,
- byte_order);
+ if (!safe_read_memory_unsigned_integer ((CORE_ADDR) pc + 1, 1, byte_order,
+ &val))
+ return -1;
+ svc_number = val;
+
if (svc_number == 0)
regcache_cooked_read_unsigned (regs, S390_R1_REGNUM, &svc_number);