From: Jon Turney <jon.turney@dronecode.org.uk>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/2] Introduce wrapper for CreateProcess
Date: Sun, 12 Jun 2022 17:08:00 +0100 [thread overview]
Message-ID: <25986c13-aed7-3123-626d-98f3b9f25150@dronecode.org.uk> (raw)
In-Reply-To: <20220311185705.774197-2-tromey@adacore.com>
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.
next prev parent reply other threads:[~2022-06-12 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 18:57 [PATCH v2 0/2] Make "set disable-randomization" work on Windows Tom Tromey
2022-03-11 18:57 ` [PATCH v2 1/2] Introduce wrapper for CreateProcess Tom Tromey
2022-06-12 16:08 ` Jon Turney [this message]
2022-03-11 18:57 ` [PATCH v2 2/2] Allow ASLR to be disabled on Windows Tom Tromey
2022-06-12 16:15 ` Jon Turney
2022-03-11 20:02 ` [PATCH v2 0/2] Make "set disable-randomization" work " Eli Zaretskii
2022-06-07 15:59 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25986c13-aed7-3123-626d-98f3b9f25150@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).