diff options
author | Will Deacon <will.deacon@arm.com> | 2011-02-25 20:19:32 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-26 13:35:50 +0000 |
commit | ba55d3db9bb59a52fe45dbc5d62776adbb289e54 (patch) | |
tree | 0d48b0655efde424085a15f83c15ecde4603df32 /arch/arm | |
parent | 8f3112707fabc2f9f932a4ac1c5b92f3266e4662 (diff) |
ARM: 6767/1: ptrace: fix register indexing in GETHBPREGS request
The GETHBPREGS ptrace request incorrectly maps its index argument onto
the thread's saved debug state when the index != 0. This has not yet
been seen from userspace because GDB (the only user of this request)
only reads from register 0.
This patch fixes the indexing.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 19c6816db61..b13e70f63d7 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -996,10 +996,10 @@ static int ptrace_gethbpregs(struct task_struct *tsk, long num, while (!(arch_ctrl.len & 0x1)) arch_ctrl.len >>= 1; - if (idx & 0x1) - reg = encode_ctrl_reg(arch_ctrl); - else + if (num & 0x1) reg = bp->attr.bp_addr; + else + reg = encode_ctrl_reg(arch_ctrl); } put: |