From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id 30BE4385DC1B for ; Wed, 15 Apr 2020 16:54:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 30BE4385DC1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id EDD7056043; Wed, 15 Apr 2020 12:54:39 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RXHdZa0Ag7AE; Wed, 15 Apr 2020 12:54:39 -0400 (EDT) Received: from murgatroyd (174-16-110-145.hlrn.qwest.net [174.16.110.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 8DE75117F80; Wed, 15 Apr 2020 12:54:39 -0400 (EDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v3 21/29] Share handle_exception References: <20200313190855.28662-1-tromey@adacore.com> <20200313190855.28662-22-tromey@adacore.com> <33cddd77-b9c5-dfaa-78cb-2812016b07fd@simark.ca> X-Attribution: Tom Date: Wed, 15 Apr 2020 10:54:39 -0600 In-Reply-To: <33cddd77-b9c5-dfaa-78cb-2812016b07fd@simark.ca> (Simon Marchi's message of "Wed, 15 Apr 2020 11:27:35 -0400") Message-ID: <87tv1kadv4.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-24.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2020 16:54:42 -0000 >>>>> "Simon" == Simon Marchi writes: Simon> This patch introduced some GDB-specific calls in nat/windows-nat.c. That Simon> file is built by gdbserver, so it breaks that build. This is when building Simon> on Cygwin: For reasons I don't really understand, I can't seem to do a Cygwin build. (And, I have little control over the Windows machines I do have access to, so I can't really fix the problem, whatever it is.) So, could you try this patch? Tom commit f4258cb31d8f39bb3779f31f55bab3de55556497 Author: Tom Tromey Date: Wed Apr 15 10:53:04 2020 -0600 Fix Cygwin gdb build Simon pointed out that the windows-nat sharing series broke the Cygwin build. This patch fixes the problem, by moving some globals into nat/windows-nat.c. gdb/ChangeLog 2020-04-15 Tom Tromey * windows-nat.c (cygwin_exceptions, cygwin_load_start) (cygwin_load_end): Move to nat/windows-nat.c. * nat/windows-nat.h (cygwin_exceptions, cygwin_load_start) (cygwin_load_end): Move definitions from windows-nat.c. * nat/windows-nat.c (cygwin_exceptions, cygwin_load_start) (cygwin_load_end): Declare. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 425c4459922..c82d8e7ff40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2020-04-15 Tom Tromey + + * windows-nat.c (cygwin_exceptions, cygwin_load_start) + (cygwin_load_end): Move to nat/windows-nat.c. + * nat/windows-nat.h (cygwin_exceptions, cygwin_load_start) + (cygwin_load_end): Move definitions from windows-nat.c. + * nat/windows-nat.c (cygwin_exceptions, cygwin_load_start) + (cygwin_load_end): Declare. + 2016-01-20 Jon Turney * windows-nat.c (windows_make_so): Warn rather than stopping with diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index cd7c1d177c6..a5e367496e8 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -45,6 +45,18 @@ EXCEPTION_RECORD siginfo_er; bool ignore_first_breakpoint = false; #endif +#ifdef __CYGWIN__ + +/* When true, break when an exception is detected in the Cygwin DLL + itself. */ +bool cygwin_exceptions = false; + +/* The starting and ending address of the cygwin1.dll text segment. */ +CORE_ADDR cygwin_load_start; +CORE_ADDR cygwin_load_end; + +#endif /* __CYGWIN__ */ + /* Note that 'debug_events' must be locally defined in the relevant functions. */ #define DEBUG_EVENTS(x) if (debug_events) debug_printf x diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index aea1519672d..0c103cb867f 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -210,6 +210,18 @@ extern EXCEPTION_RECORD siginfo_er; extern bool ignore_first_breakpoint; #endif +#ifdef __CYGWIN__ + +/* When true, break when an exception is detected in the Cygwin DLL + itself. */ +extern bool cygwin_exceptions; + +/* The starting and ending address of the cygwin1.dll text segment. */ +extern CORE_ADDR cygwin_load_start; +extern CORE_ADDR cygwin_load_end; + +#endif /* __CYGWIN__ */ + /* Return the name of the DLL referenced by H at ADDRESS. UNICODE determines what sort of string is read from the inferior. Returns the name of the DLL, or NULL on error. If a name is returned, it diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 613153bfac6..a4e15ee7a32 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -162,9 +162,6 @@ static Wow64GetThreadSelectorEntry_ftype *Wow64GetThreadSelectorEntry; # define bad_GetModuleFileNameEx bad_GetModuleFileNameExA #else # define __PMAX PATH_MAX -/* The starting and ending address of the cygwin1.dll text segment. */ - static CORE_ADDR cygwin_load_start; - static CORE_ADDR cygwin_load_end; # define __USEWIDE typedef wchar_t cygwin_buf_t; typedef DWORD WINAPI (GetModuleFileNameEx_ftype) (HANDLE, HMODULE, @@ -239,9 +236,6 @@ static bool wow64_process = false; /* User options. */ static bool new_console = false; -#ifdef __CYGWIN__ -static bool cygwin_exceptions = false; -#endif static bool new_group = true; static bool debug_exec = false; /* show execution */ static bool debug_events = false; /* show events from kernel */