diff options
author | Daniel Jacobowitz <drow@false.org> | 2005-08-04 16:41:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-04 19:28:27 -0400 |
commit | e8ed11b9dc07df0134248542ca8e7d40751a6052 (patch) | |
tree | fe86ae2bcc5b1bb0ffee134005bd2449aea0eada | |
parent | c91096d85c95c6b7fe8d7065e2aa6825e0bdaca9 (diff) |
[PATCH] x86_64: fix 32-bit thread debugging
The IA32 ptrace emulation currently returns the wrong registers for fs/gs;
it's returning what x86_64 calls gs_base. We need regs.gsindex in order
for GDB to correctly locate the TLS area. Without this patch, the 32-bit
GDB testsuite bombs on a 64-bit kernel. With it, results look about like
I'd expect, although there are still a handful of kernel-related failures
(vsyscall related?).
Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/ia32/ptrace32.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index b98b6d2462f6..2a925e2af390 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c | |||
@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) | |||
43 | switch (regno) { | 43 | switch (regno) { |
44 | case offsetof(struct user32, regs.fs): | 44 | case offsetof(struct user32, regs.fs): |
45 | if (val && (val & 3) != 3) return -EIO; | 45 | if (val && (val & 3) != 3) return -EIO; |
46 | child->thread.fs = val & 0xffff; | 46 | child->thread.fsindex = val & 0xffff; |
47 | break; | 47 | break; |
48 | case offsetof(struct user32, regs.gs): | 48 | case offsetof(struct user32, regs.gs): |
49 | if (val && (val & 3) != 3) return -EIO; | 49 | if (val && (val & 3) != 3) return -EIO; |
50 | child->thread.gs = val & 0xffff; | 50 | child->thread.gsindex = val & 0xffff; |
51 | break; | 51 | break; |
52 | case offsetof(struct user32, regs.ds): | 52 | case offsetof(struct user32, regs.ds): |
53 | if (val && (val & 3) != 3) return -EIO; | 53 | if (val && (val & 3) != 3) return -EIO; |
@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) | |||
138 | 138 | ||
139 | switch (regno) { | 139 | switch (regno) { |
140 | case offsetof(struct user32, regs.fs): | 140 | case offsetof(struct user32, regs.fs): |
141 | *val = child->thread.fs; | 141 | *val = child->thread.fsindex; |
142 | break; | 142 | break; |
143 | case offsetof(struct user32, regs.gs): | 143 | case offsetof(struct user32, regs.gs): |
144 | *val = child->thread.gs; | 144 | *val = child->thread.gsindex; |
145 | break; | 145 | break; |
146 | case offsetof(struct user32, regs.ds): | 146 | case offsetof(struct user32, regs.ds): |
147 | *val = child->thread.ds; | 147 | *val = child->thread.ds; |