[LanguageRuntime] Simplify CreateExceptionSearchFilter in derived classes

llvm-svn: 363109
This commit is contained in:
Alex Langford 2019-06-11 22:52:08 +00:00
parent 082cd30327
commit 6691f1b6cd
4 changed files with 7 additions and 12 deletions

View File

@ -136,7 +136,9 @@ public:
virtual lldb::BreakpointResolverSP
CreateExceptionResolver(Breakpoint *bkpt, bool catch_bp, bool throw_bp) = 0;
virtual lldb::SearchFilterSP CreateExceptionSearchFilter();
virtual lldb::SearchFilterSP CreateExceptionSearchFilter() {
return m_process->GetTarget().GetSearchFilterForModule(nullptr);
}
virtual bool GetTypeBitSize(const CompilerType &compiler_type,
uint64_t &size) {

View File

@ -475,16 +475,14 @@ BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
lldb::SearchFilterSP ItaniumABILanguageRuntime::CreateExceptionSearchFilter() {
Target &target = m_process->GetTarget();
FileSpecList filter_modules;
if (target.GetArchitecture().GetTriple().getVendor() == llvm::Triple::Apple) {
// Limit the number of modules that are searched for these breakpoints for
// Apple binaries.
FileSpecList filter_modules;
filter_modules.Append(FileSpec("libc++abi.dylib"));
filter_modules.Append(FileSpec("libSystem.B.dylib"));
return target.GetSearchFilterForModuleList(&filter_modules);
} else {
return LanguageRuntime::CreateExceptionSearchFilter();
}
return target.GetSearchFilterForModuleList(&filter_modules);
}
lldb::BreakpointSP ItaniumABILanguageRuntime::CreateExceptionBreakpoint(

View File

@ -453,13 +453,11 @@ bool AppleObjCRuntime::CalculateHasNewLiteralsAndIndexing() {
lldb::SearchFilterSP AppleObjCRuntime::CreateExceptionSearchFilter() {
Target &target = m_process->GetTarget();
FileSpecList filter_modules;
if (target.GetArchitecture().GetTriple().getVendor() == llvm::Triple::Apple) {
FileSpecList filter_modules;
filter_modules.Append(std::get<0>(GetExceptionThrowLocation()));
return target.GetSearchFilterForModuleList(&filter_modules);
} else {
return LanguageRuntime::CreateExceptionSearchFilter();
}
return target.GetSearchFilterForModuleList(&filter_modules);
}
ValueObjectSP AppleObjCRuntime::GetExceptionObjectForThread(

View File

@ -293,6 +293,3 @@ void LanguageRuntime::InitializeCommands(CommandObject *parent) {
}
}
lldb::SearchFilterSP LanguageRuntime::CreateExceptionSearchFilter() {
return m_process->GetTarget().GetSearchFilterForModule(nullptr);
}