add option to not create a process in a new console

This commit is contained in:
Duncan Ogilvie 2018-06-22 11:32:06 +02:00
parent b0376e7815
commit ae2c715811
2 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,8 @@ namespace GleeBug
bool Debugger::Init(const wchar_t* szFilePath, bool Debugger::Init(const wchar_t* szFilePath,
const wchar_t* szCommandLine, const wchar_t* szCommandLine,
const wchar_t* szCurrentDirectory) const wchar_t* szCurrentDirectory,
bool newConsole)
{ {
memset(&mMainStartupInfo, 0, sizeof(mMainStartupInfo)); memset(&mMainStartupInfo, 0, sizeof(mMainStartupInfo));
memset(&mMainProcess, 0, sizeof(mMainProcess)); memset(&mMainProcess, 0, sizeof(mMainProcess));
@ -39,7 +40,7 @@ namespace GleeBug
nullptr, nullptr,
nullptr, nullptr,
FALSE, FALSE,
DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | CREATE_NEW_CONSOLE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | (newConsole ? CREATE_NEW_CONSOLE : 0),
nullptr, nullptr,
szCurrentDirectory, szCurrentDirectory,
&mMainStartupInfo, &mMainStartupInfo,

View File

@ -33,11 +33,13 @@ namespace GleeBug
\param szFilePath Full pathname of the file to debug. \param szFilePath Full pathname of the file to debug.
\param szCommandLine The command line to pass to the debuggee. \param szCommandLine The command line to pass to the debuggee.
\param szCurrentDirectory Pathname of the current directory. \param szCurrentDirectory Pathname of the current directory.
\param newConsole Whether the process should start in a new console.
\return true if the debuggee was started correctly, false otherwise. \return true if the debuggee was started correctly, false otherwise.
*/ */
bool Init(const wchar_t* szFilePath, bool Init(const wchar_t* szFilePath,
const wchar_t* szCommandLine, const wchar_t* szCommandLine,
const wchar_t* szCurrentDirectory); const wchar_t* szCurrentDirectory,
bool newConsole = true);
/** /**
\brief Attach to a debuggee. \brief Attach to a debuggee.