From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51575 invoked by alias); 30 Mar 2015 10:04:59 -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 51562 invoked by uid 89); 30 Mar 2015 10:04:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Mar 2015 10:04:57 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id DBCC5A80982; Mon, 30 Mar 2015 12:04:54 +0200 (CEST) Date: Mon, 30 Mar 2015 10:04:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: [patch/cygwin] Remove dependency on __COPY_CONTEXT_SIZE Message-ID: <20150330100454.GA8372@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00989.txt.bz2 --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2325 Hi, I'd like to apply the below patch. It depends on the definition of a macro in a Cygwin header which was originally introduced to allow=20 building on Cygwin versions prior to introducing this feature. However, this macro was introduced in 2006, so the time having to rebuild on such old Cygwin versions is long gone. Above that, the definition of the macro depends on a datastructure wrongly named and residing in the wrong header. Also, __COPY_CONTEXT_SIZE is simply equivalent to sizeof(CONTEXT) anyway. Therefore I'd like to remove the dependency of GDB on this macro. Patch below. Thanks, Corinna * windows-nat.c (do_windows_fetch_inferior_registers): Drop testing and using __COPY_CONTEXT_SIZE. Just use sizeof (CONTEXT) directly instead. (handle_output_debug_string): Ditto. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index fd31083..bc4957a 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -432,15 +432,14 @@ do_windows_fetch_inferior_registers (struct regcache = *regcache, int r) =20 if (current_thread->reload_context) { -#ifdef __COPY_CONTEXT_SIZE +#ifdef __CYGWIN__ if (have_saved_context) { /* Lie about where the program actually is stopped since cygwin has informed us that we should consider the signal to have occurred at another location which is stored in "saved_context. */ - memcpy (¤t_thread->context, &saved_context, - __COPY_CONTEXT_SIZE); + memcpy (¤t_thread->context, &saved_context, sizeof (CONTEXT)); have_saved_context =3D 0; } else @@ -820,7 +819,7 @@ handle_output_debug_string (struct target_waitstatus *o= urstatus) #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 *o= urstatus) else if ((x =3D (LPCVOID) (uintptr_t) strtoull (p, NULL, 0)) && ReadProcessMemory (current_process_handle, x, &saved_context, - __COPY_CONTEXT_SIZE, &n) - && n =3D=3D __COPY_CONTEXT_SIZE) + sizeof (CONTEXT), &n) + && n =3D=3D sizeof (CONTEXT)) have_saved_context =3D 1; current_event.dwThreadId =3D retval; } --=20 Corinna Vinschen Cygwin Maintainer Red Hat --YZ5djTAD1cGYuMQK Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVGR/GAAoJEPU2Bp2uRE+gRTkQAJL+IEEy43mRpzKbRo3ZEtwm 1P0EDmRU9JPABXPcFgn6w5+c19a63olGHwQLQAQmx4JCCsVRljyNQQHbcKketCxI I9XNNbS9n4xe4G+YGEFHFgsYOwUJmtfu6mT9FXw+wn6dkdKbWz1eyhV7zjmobjZ+ s/HC1iaAMpJGg9LZ7BtrYf2XjiQk2mNukgdHgLY4nk96ibrnV5WiUvRZZz+eY3s9 lgqmfRM7LTuHsvmDoozIjJNC8ZX3YfrrnBlTxpfh/9UxLJQTPEvdeUsFX3DSffWH TJ7g0KhQERbD9w0Av//YyHG6I4rK1btnBo32CeQOkJY4UqCW7cd5PD9Oo9w8Arx0 kO3qh4irezRhdKU65F9YaamevJP14AHrjUuTeEmh41RuDW8a22dn15oPCCdIil/V 0UcQ+vvkQZYWCjUmWFEszUKBJ7Y69uSGbKe8s65dVOWmY9LRQEOIc4GThsmVn5lK O5BMnv86ezv0gkUMu0L18mFV7nnr8Sp24d1cRoxAWKVTuTRr3/Pk0IbLzW+gVIRn ig3hOJ5Lu+sVD7rT8f6HaaMbc6tVepKBHaKvA9vhluPU/IPtDilV6jO84aL1vJEM mUWSVf7Ud3W6rJUlxleh1FCrA0dJGBcnNqleGe3Zoawt+vaK4zTZoTg/zKxjb1aB X4B50HRbUrzbCCqqCLdr =bVTL -----END PGP SIGNATURE----- --YZ5djTAD1cGYuMQK--