From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PdTpOMQSbF//bgAAWB0awg (envelope-from ) for ; Wed, 23 Sep 2020 23:30:12 -0400 Received: by simark.ca (Postfix, from userid 112) id D5B071EE05; Wed, 23 Sep 2020 23:30:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0E2501E509 for ; Wed, 23 Sep 2020 23:30:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BFE3E3857C63; Thu, 24 Sep 2020 03:30:11 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E11F23857C63 for ; Thu, 24 Sep 2020 03:30:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E11F23857C63 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 7464D1E509; Wed, 23 Sep 2020 23:30:09 -0400 (EDT) Subject: Re: [PATCH 1/3] Handle 64bit breakpoints of WOW64 processes as SIGINT To: Hannes Domani , gdb-patches@sourceware.org References: <20200923172122.2089-1-ssbssa.ref@yahoo.de> <20200923172122.2089-1-ssbssa@yahoo.de> From: Simon Marchi Message-ID: <0ce3a433-4256-93e9-8843-57cd5f28ba73@simark.ca> Date: Wed, 23 Sep 2020 23:30:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200923172122.2089-1-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-09-23 1:21 p.m., Hannes Domani via Gdb-patches wrote: > When a WOW64 process triggers a breakpoint exception in 64bit code (which > happens when a 64bit gdb calls DebugBreakProcess for a 32bit target), > gdb ignores the breakpoint (because Wow64GetThreadContext can only report > the pc of 32bit code, and there is not int3 at this location). > > But if these 64bit breakpoint exceptions are handled as SIGINT, gdb > doesn't check for int3, and always stops the target. > > gdb/ChangeLog: > > 2020-09-23 Hannes Domani > > * nat/windows-nat.c (handle_exception): Handle 64bit breakpoints > in WOW64 processes as SIGINT. > * nat/windows-nat.h: Make wow64_process a shared variable. > * windows-nat.c: Remove static wow64_process variable. > > gdbserver/ChangeLog: > > 2020-09-23 Hannes Domani > > * win32-low.cc: Remove local wow64_process variable. > * win32-low.h: Remove local wow64_process variable. This is ok, but... > @@ -240,6 +241,13 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions) > ourstatus->kind = TARGET_WAITKIND_SPURIOUS; > ignore_first_breakpoint = false; > } > + else if (wow64_process) > + { > + DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT"); > + rec->ExceptionCode = DBG_CONTROL_C; > + ourstatus->value.sig = GDB_SIGNAL_INT; > + break; > + } ...please add a comment here saying why this particular handling exists, it's really not intuitive. Simon