forked from OSchip/llvm-project
Support looking up absolute symbols
The Swift stdlib uses absolute symbols in the dylib to communicate feature flags to the process. LLDB's expression evaluator needs to be able to find them. This wires up absolute symbols so they show up in the symtab lookup command, which is also all that's needed for them to be visible to the expression evaluator JIT. rdar://85093828 Differential Revision: https://reviews.llvm.org/D113445
This commit is contained in:
parent
196554d42d
commit
c9881c7d99
|
@ -115,7 +115,8 @@ void Symbol::Clear() {
|
|||
}
|
||||
|
||||
bool Symbol::ValueIsAddress() const {
|
||||
return m_addr_range.GetBaseAddress().GetSection().get() != nullptr;
|
||||
return m_addr_range.GetBaseAddress().GetSection().get() != nullptr ||
|
||||
m_type == eSymbolTypeAbsolute;
|
||||
}
|
||||
|
||||
ConstString Symbol::GetDisplayName() const {
|
||||
|
|
|
@ -1100,6 +1100,7 @@ void Symtab::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
|
|||
case eSymbolTypeCode:
|
||||
case eSymbolTypeResolver:
|
||||
case eSymbolTypeReExported:
|
||||
case eSymbolTypeAbsolute:
|
||||
symbol_indexes.push_back(temp_symbol_indexes[i]);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# RUN: %clang %s -g -c -o %t.o
|
||||
# RUN: %lldb -b -o 'target modules lookup -s absolute_symbol' %t.o | FileCheck %s
|
||||
# CHECK: 1 symbols match 'absolute_symbol'
|
||||
# CHECK: Address: 0x0000000012345678 (0x0000000012345678)
|
||||
# CHECK: Summary: 0x0000000012345678
|
||||
.globl absolute_symbol
|
||||
absolute_symbol = 0x12345678
|
Loading…
Reference in New Issue