Bug 1428772 - Report the process type when pausing a child process on startup for debugging. r?froydnj
MozReview-Commit-ID: 3MnhQmukPnZ
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -526,27 +526,29 @@ XRE_InitChildProcess(int aArgc,
#ifdef OS_POSIX
if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
#if defined(XP_LINUX) && defined(DEBUG)
if (prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0) != 0) {
printf_stderr("Could not allow ptrace from any process.\n");
}
#endif
- printf_stderr("\n\nCHILDCHILDCHILDCHILD\n debug me @ %d\n\n",
+ printf_stderr("\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %d\n\n",
+ XRE_ChildProcessTypeToString(XRE_GetProcessType()),
base::GetCurrentProcId());
sleep(GetDebugChildPauseTime());
}
#elif defined(OS_WIN)
if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS")) {
NS_DebugBreak(NS_DEBUG_BREAK,
"Invoking NS_DebugBreak() to debug child process",
nullptr, __FILE__, __LINE__);
} else if (PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
- printf_stderr("\n\nCHILDCHILDCHILDCHILD\n debug me @ %d\n\n",
+ printf_stderr("\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %d\n\n",
+ XRE_ChildProcessTypeToString(XRE_GetProcessType()),
base::GetCurrentProcId());
::Sleep(GetDebugChildPauseTime());
}
#endif
// child processes launched by GeckoChildProcessHost get this magic
// argument appended to their command lines
const char* const parentPIDString = aArgv[aArgc-1];