[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53613793.6070600@redhat.com>
Date: Wed, 30 Apr 2014 18:49:07 +0100
From: Pedro Alves <palves@...hat.com>
To: Mark Kettenis <mark.kettenis@...all.nl>
CC: hpa@...or.com, pinskia@...il.com, teawater@...il.com,
tglx@...utronix.de, mingo@...hat.com, x86@...nel.org,
eparis@...hat.com, ak@...ux.intel.com,
linux-kernel@...r.kernel.org, gdb@...rceware.org
Subject: Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by
GDB
On 04/30/2014 02:35 PM, Mark Kettenis wrote:
>> Date: Tue, 29 Apr 2014 22:10:15 -0700
>> From: "H. Peter Anvin" <hpa@...or.com>
>>
>> On 04/29/2014 10:08 PM, Andrew Pinski wrote:
>>>
>>> restoring the values is hard since even the ptrace interface does not
>>> allow for that.
>>>
>>
>> So that begs the ultimate question, which is: given the fact that there
>> is *state missing* from the state vector (this is the core of the
>> problem), is there a way we can add that state so that gdb will be able
>> to save and restore it?
>
> Carrying around additional state in GDB is complicated; I'd rather
> avoid it.
Agreed very much.
> arch/x86/kernel/ptrace.c:putreg32() has this bit of code:
>
> case offsetof(struct user32, regs.orig_eax):
> /*
> * A 32-bit debugger setting orig_eax means to restore
> * the state of the task restarting a 32-bit syscall.
> * Make sure we interpret the -ERESTART* codes correctly
> * in case the task is not actually still sitting at the
> * exit from a 32-bit syscall with TS_COMPAT still set.
> */
> regs->orig_ax = value;
> if (syscall_get_nr(child, regs) >= 0)
> task_thread_info(child)->status |= TS_COMPAT;
> break;
>
> which gets used for 32-bit compat ptrace(2). Perhaps the same logic
> should be added to putreg() if the child is a 32-bit process?
Sounds like the right fix to me.
--
Pedro Alves
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists