diff --git a/GleeBug/Debugger.cpp b/GleeBug/Debugger.cpp index 1d710f8..229da83 100644 --- a/GleeBug/Debugger.cpp +++ b/GleeBug/Debugger.cpp @@ -13,7 +13,8 @@ namespace GleeBug bool Debugger::Init(const wchar_t* szFilePath, const wchar_t* szCommandLine, - const wchar_t* szCurrentDirectory) + const wchar_t* szCurrentDirectory, + bool newConsole) { memset(&mMainStartupInfo, 0, sizeof(mMainStartupInfo)); memset(&mMainProcess, 0, sizeof(mMainProcess)); @@ -39,7 +40,7 @@ namespace GleeBug nullptr, nullptr, FALSE, - DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | CREATE_NEW_CONSOLE, + DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | (newConsole ? CREATE_NEW_CONSOLE : 0), nullptr, szCurrentDirectory, &mMainStartupInfo, diff --git a/GleeBug/Debugger.h b/GleeBug/Debugger.h index 3fbb6fd..552b8fb 100644 --- a/GleeBug/Debugger.h +++ b/GleeBug/Debugger.h @@ -33,11 +33,13 @@ namespace GleeBug \param szFilePath Full pathname of the file to debug. \param szCommandLine The command line to pass to the debuggee. \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. */ bool Init(const wchar_t* szFilePath, const wchar_t* szCommandLine, - const wchar_t* szCurrentDirectory); + const wchar_t* szCurrentDirectory, + bool newConsole = true); /** \brief Attach to a debuggee.