Skip to content

Commit 718808e

Browse files
authored
Merge pull request swiftlang#7544 from chelcassanova/find-load-address-refactor
[lldb][Target] Refactor Target::FindLoadAddr
2 parents a19ef51 + e2ce08a commit 718808e

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,14 +1359,6 @@ class Target : public std::enable_shared_from_this<Target>,
13591359
const EvaluateExpressionOptions &options = EvaluateExpressionOptions(),
13601360
std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
13611361

1362-
// Look up a symbol by name and type in both the target's symbols and the
1363-
// persistent symbols from the
1364-
// expression parser. The symbol_type is ignored in that case, for now we
1365-
// don't have symbol types for the
1366-
// persistent variables.
1367-
lldb::addr_t FindLoadAddrForNameInSymbolsAndPersistentVariables(
1368-
ConstString name_const_str, lldb::SymbolType symbol_type);
1369-
13701362
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name);
13711363

13721364
lldb::addr_t GetPersistentSymbol(ConstString name);

lldb/source/Target/Target.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3781,52 +3781,6 @@ bool Target::SetSectionUnloaded(const lldb::SectionSP &section_sp,
37813781

37823782
void Target::ClearAllLoadedSections() { m_section_load_history.Clear(); }
37833783

3784-
lldb::addr_t Target::FindLoadAddrForNameInSymbolsAndPersistentVariables(
3785-
ConstString name_const_str, SymbolType symbol_type) {
3786-
lldb::addr_t symbol_addr = LLDB_INVALID_ADDRESS;
3787-
SymbolContextList sc_list;
3788-
3789-
GetImages().FindSymbolsWithNameAndType(name_const_str, symbol_type, sc_list);
3790-
if (!sc_list.IsEmpty()) {
3791-
SymbolContext desired_symbol;
3792-
3793-
if (sc_list.GetSize() == 1 &&
3794-
sc_list.GetContextAtIndex(0, desired_symbol)) {
3795-
if (desired_symbol.symbol) {
3796-
symbol_addr = desired_symbol.symbol->GetAddress().GetLoadAddress(this);
3797-
}
3798-
} else if (sc_list.GetSize() > 1) {
3799-
for (size_t i = 0; i < sc_list.GetSize(); i++) {
3800-
if (sc_list.GetContextAtIndex(i, desired_symbol)) {
3801-
if (desired_symbol.symbol) {
3802-
symbol_addr =
3803-
desired_symbol.symbol->GetAddress().GetLoadAddress(this);
3804-
if (symbol_addr != LLDB_INVALID_ADDRESS)
3805-
break;
3806-
}
3807-
}
3808-
}
3809-
}
3810-
}
3811-
3812-
if (symbol_addr == LLDB_INVALID_ADDRESS) {
3813-
// If we didn't find it in the symbols, check the ClangPersistentVariables,
3814-
// 'cause we may have
3815-
// made it by hand.
3816-
ConstString mangled_const_str;
3817-
if (name_const_str.GetMangledCounterpart(mangled_const_str))
3818-
symbol_addr = GetPersistentSymbol(mangled_const_str);
3819-
}
3820-
3821-
if (symbol_addr == LLDB_INVALID_ADDRESS) {
3822-
// Let's try looking for the name passed-in itself, as it might be a mangled
3823-
// name
3824-
symbol_addr = GetPersistentSymbol(name_const_str);
3825-
}
3826-
3827-
return symbol_addr;
3828-
}
3829-
38303784
void Target::SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info) {
38313785
if (process_info.IsScriptedProcess()) {
38323786
// Only copy scripted process launch options.

0 commit comments

Comments
 (0)