From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39024 invoked by alias); 31 Mar 2015 12:34:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 39010 invoked by uid 89); 31 Mar 2015 12:34:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 31 Mar 2015 12:34:14 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 52C75B5BD7 for ; Tue, 31 Mar 2015 12:34:13 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2VCYCqK008847 for ; Tue, 31 Mar 2015 08:34:12 -0400 Message-ID: <551A9443.5010907@redhat.com> Date: Tue, 31 Mar 2015 12:34:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [patch/cygwin] Remove dependency on __COPY_CONTEXT_SIZE References: <20150330100454.GA8372@calimero.vinschen.de> In-Reply-To: <20150330100454.GA8372@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg01038.txt.bz2 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