aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-07 14:41:52 -0600
committerTom Tromey <tromey@adacore.com>2022-06-07 09:59:40 -0600
commit8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008 (patch)
tree56272b04e80d52f561d31267d0e719db65227ea0 /gdb/windows-nat.c
parent265aa48b392cda4355b5875fde46b59c271cc093 (diff)
downloadfsf-binutils-gdb-8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008.zip
fsf-binutils-gdb-8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008.tar.gz
fsf-binutils-gdb-8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008.tar.bz2
Introduce wrapper for CreateProcess
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.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 8631a1b..262619d 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -78,12 +78,10 @@ using namespace windows_nat;
static windows_process_info windows_process;
#undef STARTUPINFO
-#undef CreateProcess
#ifndef __CYGWIN__
# define __PMAX (MAX_PATH + 1)
# define STARTUPINFO STARTUPINFOA
-# define CreateProcess CreateProcessA
#else
# define __PMAX PATH_MAX
/* The starting and ending address of the cygwin1.dll text segment. */
@@ -92,7 +90,6 @@ static windows_process_info windows_process;
# define __USEWIDE
typedef wchar_t cygwin_buf_t;
# define STARTUPINFO STARTUPINFOW
-# define CreateProcess CreateProcessW
#endif
static int have_saved_context; /* True if we've saved context from a
@@ -2494,17 +2491,9 @@ windows_nat_target::create_inferior (const char *exec_file,
}
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);
if (w32_env)
/* Just free the Win32 environment, if it could be created. */
free (w32_env);
@@ -2618,11 +2607,8 @@ windows_nat_target::create_inferior (const char *exec_file,
*temp = 0;
windows_init_thread_list ();
- ret = CreateProcessA (0,
+ ret = create_process (nullptr, /* image */
args, /* command line */
- NULL, /* Security */
- NULL, /* thread */
- TRUE, /* inherit handles */
flags, /* start flags */
w32env, /* environment */
inferior_cwd, /* current directory */