From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-047.btinternet.com (mailomta2-sa.btinternet.com [213.120.69.8]) by sourceware.org (Postfix) with ESMTPS id 3FC723858C2C for ; Sun, 12 Jun 2022 16:08:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3FC723858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-003.btmx-prd.synchronoss.net ([10.2.38.6]) by sa-prd-fep-047.btinternet.com with ESMTP id <20220612160802.HVQZ3256.sa-prd-fep-047.btinternet.com@sa-prd-rgout-003.btmx-prd.synchronoss.net>; Sun, 12 Jun 2022 17:08:02 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 61394290292E81CB X-Originating-IP: [86.139.167.41] X-OWM-Source-IP: 86.139.167.41 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvfedrudduhedgledvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeffkeeigfdujeehteduiefgjeeltdelgeelteekudetfedtffefhfeufefgueettdenucfkphepkeeirddufeelrdduieejrdegudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddthegnpdhinhgvthepkeeirddufeelrdduieejrdeguddpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepghgusgdqphgrthgthhgvshesshhouhhrtggvfigrrhgvrdhorhhgpdhrtghpthhtohepthhrohhmvgihsegruggrtghorhgvrdgtohhm X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.105] (86.139.167.41) by sa-prd-rgout-003.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 61394290292E81CB; Sun, 12 Jun 2022 17:08:02 +0100 Message-ID: <25986c13-aed7-3123-626d-98f3b9f25150@dronecode.org.uk> Date: Sun, 12 Jun 2022 17:08:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 1/2] Introduce wrapper for CreateProcess Content-Language: en-GB To: Tom Tromey , gdb-patches@sourceware.org References: <20220311185705.774197-1-tromey@adacore.com> <20220311185705.774197-2-tromey@adacore.com> From: Jon Turney In-Reply-To: <20220311185705.774197-2-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1199.3 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Sun, 12 Jun 2022 16:08:05 -0000 On 11/03/2022 18:57, Tom Tromey via Gdb-patches wrote: > This is a small refactoring that introduces a wrapper for the Windows > CreateProcess function. This is done to make the next patch a bit > simpler. > --- > gdb/nat/windows-nat.c | 51 ++++++++++++++++++++++++++++++++++++++++++ > gdb/nat/windows-nat.h | 15 +++++++++++++ > gdb/windows-nat.c | 22 ++++-------------- > gdbserver/win32-low.cc | 5 +---- > 4 files changed, 71 insertions(+), 22 deletions(-) > > diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c > index 21445f3f859..fdfc8e702f8 100644 > --- a/gdb/nat/windows-nat.c > +++ b/gdb/nat/windows-nat.c > @@ -579,6 +579,57 @@ wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout) [...] > +#ifdef __CYGWIN__ > + > +/* See nat/windows-nat.h. */ > + > +BOOL > +create_process (const wchar_t *image, wchar_t *command_line, DWORD flags, > + void *environment, const wchar_t *cur_dir, > + STARTUPINFOW *startup_info, > + PROCESS_INFORMATION *process_info); > +{ Stray semicolon > + return create_process_wrapper (CreateProcessW, image, command_line, flags, > + environment, cur_dir, > + startup_info, process_info); > +} > + > +#endif /* __CYGWIN__ */ [...] > diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c > index 81e26fe4759..251876c7022 100644 > --- a/gdb/windows-nat.c > +++ b/gdb/windows-nat.c > windows_init_thread_list (); > - ret = CreateProcess (0, > - args, /* command line */ > - NULL, /* Security */ > - NULL, /* thread */ > - TRUE, /* inherit handles */ > - flags, /* start flags */ > - w32_env, /* environment */ > - inferior_cwd != NULL ? infcwd : NULL, /* current > - directory */ > - &si, > - &pi); > + ret = create_process (args, flags, w32_env, > + inferior_cwd != nullptr ? infcwd : nullptr, > + &si, &pi); This use of create_process() under CYGWIN has one less argument that the prototype as the NULL program argument was dropped. I pushed a patch to fix these cygwin build issues as trivial.