From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C4B793893654 for ; Wed, 29 Apr 2020 15:09:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4B793893654 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.193] (unknown [192.222.164.54]) (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 C54C91F068; Wed, 29 Apr 2020 11:09:11 -0400 (EDT) Subject: Re: [PATCH v2] Implement debugging of WOW64 processes in gdbserver To: Hannes Domani , Gdb-patches References: <20200427133416.9314-1-ssbssa.ref@yahoo.de> <20200427133416.9314-1-ssbssa@yahoo.de> <7ec0c0b7-5425-d766-326b-9d5b13b755b4@simark.ca> <471105047.4011567.1588157665165@mail.yahoo.com> From: Simon Marchi Message-ID: Date: Wed, 29 Apr 2020 11:09:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <471105047.4011567.1588157665165@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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, 29 Apr 2020 15:09:13 -0000 On 2020-04-29 6:54 a.m., Hannes Domani via Gdb-patches wrote: >> Since this is copied from gdb/windows-nat.c, it would be nice to factor it >> out (as well as the small snippet below), so it can be shared.  Otherwise, >> if we make a fix to one, we'll most likely forget to fix the other. >> >> The shared versions would go into gdb/nat/windows-nat.c. > > There might be even more code that can be shared now, I planned to do this > with a later patch. Ok. >> Why do we need to get these functions like this, instead of just calling them? > > These functions are not available on WinXP, and the extra check for them > was actually the reason of this v2: > > +  if (wow64_process > +      && (win32_Wow64SuspendThread == nullptr > +      || win32_Wow64GetThreadContext == nullptr > +      || win32_Wow64SetThreadContext == nullptr)) > +    error ("WOW64 debugging is not supported on this system.\n"); Ok, please add a comment to that effect then. This way if we decide we no longer want to support Windows XP, we can remove this in favor of just calling the functions directly. Simon