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: Tue, 31 Mar 2015 13:34:11 +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>
On 03/30/2015 11:04 AM, Corinna Vinschen wrote:
> @@ -820,7 +819,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
> #endif
> warning (("%s"), s);
> }
> -#ifdef __COPY_CONTEXT_SIZE
> +#ifdef __CYGWIN__
> else
> {
> /* Got a cygwin signal marker. A cygwin signal is followed by
> @@ -847,8 +846,8 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
> else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
> && ReadProcessMemory (current_process_handle, x,
> &saved_context,
> - __COPY_CONTEXT_SIZE, &n)
> - && n == __COPY_CONTEXT_SIZE)
> + sizeof (CONTEXT), &n)
Is that really wise? AFAIK, the size of the CONTEXT structure can
grow as MSFT adds more registers to support newer machines.
It seems to me that the gdb and cygwin.dll builds can disagree
on the size of that structure. Seems to me that this mechanism should
have a way to let GDB know the size of the context structure. Or maybe
read just saved_context.ContextFlags first, and infer the size from
that, reading in the most we understand?
> + && n == sizeof (CONTEXT))
> have_saved_context = 1;
> current_event.dwThreadId = retval;
> }
>
Thanks,
Pedro Alves