diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc index 30fd82de7901d6..791ef502d64393 100644 --- a/content/utility/utility_main.cc +++ b/content/utility/utility_main.cc @@ -103,8 +103,15 @@ int UtilityMain(const MainFunctionParams& parameters) { base::SingleThreadTaskExecutor main_thread_task_executor(message_pump_type); base::PlatformThread::SetName("CrUtilityMain"); - if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog)) - WaitForDebugger("Utility"); + if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog)) { + auto dialog_match = parameters.command_line.GetSwitchValueASCII( + switches::kUtilityStartupDialog); + auto sub_type = + parameters.command_line.GetSwitchValueASCII(switches::kUtilitySubType); + if (dialog_match.empty() || dialog_match == sub_type) { + WaitForDebugger(sub_type.empty() ? "Utility" : sub_type); + } + } #if defined(OS_LINUX) || defined(OS_CHROMEOS) // Initializes the sandbox before any threads are created. diff --git a/docs/linux/debugging.md b/docs/linux/debugging.md index 9ecefa546cd473..38e4d9603bea2a 100644 --- a/docs/linux/debugging.md +++ b/docs/linux/debugging.md @@ -83,6 +83,10 @@ to debug the renderer code. Go to https://www.chromium.org/blink/getting-started-with-blink-debugging for more information on how this can be done. +For utilities you can use `--utility-startup-dialog` to have all utilities +prompt, or `--utility-startup-dialog=data_decoder.mojom.DataDecoderService` +to debug only a particular service type. + #### Choosing which renderers to debug If you are starting multiple renderers then the above means that multiple gdb's diff --git a/docs/mac/debugging.md b/docs/mac/debugging.md index 8cd36e961c05ee..420faef475523a 100644 --- a/docs/mac/debugging.md +++ b/docs/mac/debugging.md @@ -173,7 +173,7 @@ these startup-dialog switches for the relevant process type: * `--renderer-startup-dialog` * `--utility-startup-dialog` -* `--renderer-startup-dialog` +* `--utility-startup-dialog=data_decoder.mojom.DataDecoderService` After the process launches, it will print a message like this to standard error: