aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppah-nat.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-03-20 15:38:56 +0000
committerStu Grossman <grossman@cygnus>1995-03-20 15:38:56 +0000
commita15f6b0a8e527e2424d031e8916857b7c67f1984 (patch)
treeca20bc873413f310b99be60dacc10785dfadf6de /gdb/hppah-nat.c
parent5c26250b95bae82df80cab9985c6857203c9b93b (diff)
downloadgdb-a15f6b0a8e527e2424d031e8916857b7c67f1984.zip
gdb-a15f6b0a8e527e2424d031e8916857b7c67f1984.tar.gz
gdb-a15f6b0a8e527e2424d031e8916857b7c67f1984.tar.bz2
* hppah-nat.c (store_inferior_registers): Move check for
CANNOT_STORE_REGISTER to a better place. Fixes ptrace I/O errors found by test suite during function calls, which attempts to write unwritable registers.
Diffstat (limited to 'gdb/hppah-nat.c')
-rw-r--r--gdb/hppah-nat.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index 5681658..bbea4c9 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -60,6 +60,8 @@ store_inferior_registers (regno)
if (regno >= 0)
{
+ if (CANNOT_STORE_REGISTER (regno))
+ return;
regaddr = register_addr (regno, offset);
errno = 0;
if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
@@ -90,22 +92,14 @@ store_inferior_registers (regno)
sprintf (msg, "writing register %s: %s",
reg_names[regno], err);
warning (msg);
- goto error_exit;
+ return;
}
regaddr += sizeof(int);
}
}
else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- if (CANNOT_STORE_REGISTER (regno))
- continue;
- store_inferior_registers (regno);
- }
- }
- error_exit:
- return;
+ for (regno = 0; regno < NUM_REGS; regno++)
+ store_inferior_registers (regno);
}
/* Fetch one register. */