Skip to content

Commit 41978f9

Browse files
committed
DBG: show full command line near 'Process Started' log entry
1 parent ee411b0 commit 41978f9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/dbg/debugger.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,22 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
13371337
strcpy_s(DebugFileName, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", "??? (GetFileNameFromHandle failed)")));
13381338
dprintf(QT_TRANSLATE_NOOP("DBG", "Process Started: %p %s\n"), base, DebugFileName);
13391339

1340+
char* cmdline = nullptr;
1341+
if(dbggetcmdline(&cmdline, nullptr, fdProcessInfo->hProcess))
1342+
{
1343+
// Parse the command line from the debuggee
1344+
int argc = 0;
1345+
wchar_t** argv = CommandLineToArgvW(StringUtils::Utf8ToUtf16(cmdline).c_str(), &argc);
1346+
LocalFree(argv);
1347+
1348+
// Print the command line to the log
1349+
dprintf_untranslated(" %s\n", cmdline);
1350+
for(int i = 0; i < argc; i++)
1351+
dprintf_untranslated(" argv[%i]: %s\n", i, StringUtils::Utf16ToUtf8(argv[i]).c_str());
1352+
1353+
efree(cmdline);
1354+
}
1355+
13401356
//update memory map
13411357
MemUpdateMap();
13421358
GuiUpdateMemoryView();

0 commit comments

Comments
 (0)