Roland McGrath 84c6f6046c x86_64: make ptrace always sign-extend orig_ax to 64 bits
This makes 64-bit ptrace calls setting the 64-bit orig_ax field for a
32-bit task sign-extend the low 32 bits up to 64.  This matches what a
64-bit debugger expects when tracing a 32-bit task.

This follows on my "x86_64 ia32 syscall restart fix".  This didn't
matter until that was fixed.

The debugger ignores or zeros the high half of every register slot it
sets (including the orig_rax pseudo-register) uniformly.  It expects
that the setting of the low 32 bits always has the same meaning as a
32-bit debugger setting those same 32 bits with native 32-bit
facilities.

This never arose before because the syscall restart check never
matched any -ERESTART* values due to lack of sign extension.  Before
that fix, even 32-bit ptrace setting orig_eax to -1 failed to trigger
the restart check anyway.  So this was never noticed as a regression
of 64-bit debuggers vs 32-bit debuggers on the same 64-bit kernel.

Signed-off-by: Roland McGrath <roland@redhat.com>
[ Changed to just do the sign-extension unconditionally on x86-64,
  since orig_ax is always just a small integer and doesn't need
  the full 64-bit range ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-07 19:05:58 -08:00
..
2007-10-17 21:19:04 +02:00
2008-01-30 13:33:14 +01:00
2008-02-26 12:55:49 +01:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2007-10-19 11:53:33 -07:00
2007-10-13 10:01:23 -07:00
2008-01-30 13:31:31 +01:00
2008-01-31 22:05:47 +01:00
2008-01-30 13:33:32 +01:00
2008-02-19 16:18:28 +01:00
2007-10-11 11:17:01 +02:00
2008-01-30 13:31:19 +01:00
2008-02-19 16:18:28 +01:00
2008-02-19 16:18:29 +01:00
2008-02-26 12:55:50 +01:00
2008-03-07 16:39:14 +01:00
2008-02-13 16:20:35 +01:00
2008-02-19 16:18:29 +01:00
2008-01-30 13:33:10 +01:00
2007-10-11 11:17:24 +02:00
2007-10-13 10:01:23 -07:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2008-01-30 13:33:19 +01:00
2008-01-30 13:30:31 +01:00
2008-02-14 23:30:20 +01:00
2007-10-11 11:17:01 +02:00
2008-03-07 16:39:14 +01:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2008-01-30 13:32:40 +01:00
2008-01-30 13:33:24 +01:00
2008-02-19 16:18:28 +01:00
2007-10-11 11:17:01 +02:00
2008-03-07 16:39:14 +01:00
2007-10-20 01:13:56 +02:00
2007-10-17 08:42:55 -07:00
2008-02-08 09:22:29 -08:00
2008-02-29 18:55:39 +01:00
2008-01-30 13:31:52 +01:00
2008-02-06 22:39:44 +01:00
2008-01-30 13:33:24 +01:00
2007-10-11 11:17:24 +02:00
2008-01-30 13:31:42 +01:00
2008-02-04 16:47:54 +01:00
2007-10-11 11:17:01 +02:00
2008-01-30 13:31:10 +01:00