diff --git a/lldb/include/lldb/Target/InstrumentationRuntime.h b/lldb/include/lldb/Target/InstrumentationRuntime.h index a6121c24b9560..d2499528e97ab 100644 --- a/lldb/include/lldb/Target/InstrumentationRuntime.h +++ b/lldb/include/lldb/Target/InstrumentationRuntime.h @@ -73,6 +73,13 @@ class InstrumentationRuntime /// is guaranteed to be loaded. virtual void Activate() = 0; + /// \return true if `CheckIfRuntimeIsValid` should be called on all modules. + /// In this case the return value of `GetPatternForRuntimeLibrary` will be + /// ignored. Return false if `CheckIfRuntimeIsValid` should only be called + /// for modules whose name matches `GetPatternForRuntimeLibrary`. + /// + virtual bool MatchAllModules() { return false; } + public: static void ModulesDidLoad(lldb_private::ModuleList &module_list, Process *process, diff --git a/lldb/source/Target/InstrumentationRuntime.cpp b/lldb/source/Target/InstrumentationRuntime.cpp index 7e58e8bf26cb1..d9800a8541f4e 100644 --- a/lldb/source/Target/InstrumentationRuntime.cpp +++ b/lldb/source/Target/InstrumentationRuntime.cpp @@ -55,7 +55,8 @@ void InstrumentationRuntime::ModulesDidLoad( return IterationAction::Continue; const RegularExpression &runtime_regex = GetPatternForRuntimeLibrary(); - if (runtime_regex.Execute(file_spec.GetFilename().GetCString()) || + if (MatchAllModules() || + runtime_regex.Execute(file_spec.GetFilename().GetCString()) || module_sp->IsExecutable()) { if (CheckIfRuntimeIsValid(module_sp)) { SetRuntimeModuleSP(module_sp);