aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-08-05 09:21:47 +0000
committerPavel Labath <pavel@labath.sk>2019-08-05 09:21:47 +0000
commitd5d47a3574823635fddef3bba3de37e2a5ea0d76 (patch)
tree1f0f9b4cde535e98639ac220cb6f45e80aab4dfd /lldb/source/Plugins/DynamicLoader
parent8ed8353fc45e3906f7fd8dde1072bce7b54aca62 (diff)
downloadllvm-d5d47a3574823635fddef3bba3de37e2a5ea0d76.tar.gz
llvm-d5d47a3574823635fddef3bba3de37e2a5ea0d76.tar.bz2
llvm-d5d47a3574823635fddef3bba3de37e2a5ea0d76.zip
Remove SymbolVendor::GetSymtab
Summary: This patch removes the GetSymtab method from the SymbolVendor, which is a no-op as it's implementation just forwards to the relevant SymbolFile. Instead it creates a Module::GetSymtab, which calls the SymbolFile method directly. All callers have been updated to use the Module method directly instead of a two phase GetSymbolVendor->GetSymtab search, which leads to reduced intentation in a lot of deeply nested code. Reviewers: clayborg, JDevlieghere, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65569 llvm-svn: 367820
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 057c20f1fb23..aab0e126a0f6 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -370,22 +370,18 @@ bool DynamicLoaderMacOS::SetNotificationBreakpoint() {
addr_t
DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(Module *module) {
SymbolContext sc;
- SymbolVendor *sym_vendor = module->GetSymbolVendor();
Target &target = m_process->GetTarget();
- if (sym_vendor) {
- Symtab *symtab = sym_vendor->GetSymtab();
- if (symtab) {
- std::vector<uint32_t> match_indexes;
- ConstString g_symbol_name("_dyld_global_lock_held");
- uint32_t num_matches = 0;
- num_matches =
- symtab->AppendSymbolIndexesWithName(g_symbol_name, match_indexes);
- if (num_matches == 1) {
- Symbol *symbol = symtab->SymbolAtIndex(match_indexes[0]);
- if (symbol &&
- (symbol->ValueIsAddress() || symbol->GetAddressRef().IsValid())) {
- return symbol->GetAddressRef().GetOpcodeLoadAddress(&target);
- }
+ if (Symtab *symtab = module->GetSymtab()) {
+ std::vector<uint32_t> match_indexes;
+ ConstString g_symbol_name("_dyld_global_lock_held");
+ uint32_t num_matches = 0;
+ num_matches =
+ symtab->AppendSymbolIndexesWithName(g_symbol_name, match_indexes);
+ if (num_matches == 1) {
+ Symbol *symbol = symtab->SymbolAtIndex(match_indexes[0]);
+ if (symbol &&
+ (symbol->ValueIsAddress() || symbol->GetAddressRef().IsValid())) {
+ return symbol->GetAddressRef().GetOpcodeLoadAddress(&target);
}
}
}