From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id j5LoH3C7bF9RAQAAWB0awg (envelope-from ) for ; Thu, 24 Sep 2020 11:29:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 5B7E61EE05; Thu, 24 Sep 2020 11:29:52 -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 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 753321E509 for ; Thu, 24 Sep 2020 11:29:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D3373851C27; Thu, 24 Sep 2020 15:29:51 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B4D123857C52 for ; Thu, 24 Sep 2020 15:29:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B4D123857C52 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 63AC81E509; Thu, 24 Sep 2020 11:29:49 -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> <0ce3a433-4256-93e9-8843-57cd5f28ba73@simark.ca> <2023373258.594579.1600961165295@mail.yahoo.com> From: Simon Marchi Message-ID: Date: Thu, 24 Sep 2020 11:29:48 -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: <2023373258.594579.1600961165295@mail.yahoo.com> 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-24 11:26 a.m., Hannes Domani wrote: > Is it ok with this addition?: > > diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c > index a277156138..2cbbc0f2cc 100644 > --- a/gdb/nat/windows-nat.c > +++ b/gdb/nat/windows-nat.c > @@ -243,6 +243,13 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions) > } > else if (wow64_process) > { > + /* This breakpoint exception is triggered for WOW64 processes when > + reaching an int3 instruction in 64bit code. > + gdb checks for int3 in case of SIGTRAP, this fails because > + Wow64GetThreadContext can only report the pc of 32bit code, and > + gdb lets the target process continue. > + So handle it as SIGINT instead, then the target is stopped > + unconditionally. */ > DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT"); > rec->ExceptionCode = DBG_CONTROL_C; > ourstatus->value.sig = GDB_SIGNAL_INT; That is fine with me, thanks. Just to make sure I understand, stopping a 32-bit process from a 64-bit GDB is the only time we expect this to happen, right? Simon