This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch/cygwin] Remove dependency on __COPY_CONTEXT_SIZE
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 01 Apr 2015 11:44:46 +0100
- Subject: Re: [patch/cygwin] Remove dependency on __COPY_CONTEXT_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <20150330100454 dot GA8372 at calimero dot vinschen dot de> <551A9443 dot 5010907 at redhat dot com> <20150331143643 dot GA10846 at calimero dot vinschen dot de> <551AB630 dot 4010800 at redhat dot com> <20150331154215 dot GL13285 at calimero dot vinschen dot de> <551ACB9E dot 2080902 at redhat dot com> <20150331183239 dot GA14520 at calimero dot vinschen dot de>
On 03/31/2015 07:32 PM, Corinna Vinschen wrote:
> On Mar 31 17:30, Pedro Alves wrote:
>>>> That's not true. GetThreadContext takes a size parameter,
>>>> and only writes to the bits that the caller requests with
>>>> context.ContextFlags.
>>>
>>> The ContextFlags member is not a size parameter,
>>
>> I didn't say it was. The GetThreadContext function takes
>> an IN+OUT size parameter in _addition to the ContextFlags flag.
>
> Uhm...no, it doesn't. The prototype is
>
> BOOL WINAPI GetThreadContext(
> _In_ HANDLE hThread,
> _Inout_ LPCONTEXT lpContext
> );
Eh, somehow I got confused. Sorry about that.
>> I'm almost sure in the old days, the CONTEXT structure didn't have
>> the ExtendedRegisters field at all.
>
> I don't know about that. But the fact that CONTEXT is not a opaque
> structure but exposed to user space speaks against that. Every time
> a Win32 datatype needs a change, MSFT kept the old datatype intact
> and added an "Ex" or "2" type instead, just as with the functions.
OK.
>
>> I think it's bad to hard code
>> the size of the CONTEXT structure, but won't argue further. Patch
>> is OK if you'd really like to apply it as is.
>
> Thanks. But incidentally I retract the patch. It seems we made a
> mistake both, on 32 and 64 bit Cygwin as far as the definition of
> __COPY_CONTEXT_SIZE is concerned. Changing that to sizeof(CONTEXT) now
> would potentially break backward compatibility with all Cygwin versions
> up to today. Oh well.
Not sure I understand what you mean, but OK.
> Sorry for the longish discussion for nothing :(
Sounds like it wasn't for nothing then.
Thanks,
Pedro Alves