Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanCallFunction.h"
#include "lldb/Target/ThreadPlanRunToAddress.h"
#include "lldb/Target/ThreadPlanStepInstruction.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBLog.h"
Expand Down Expand Up @@ -924,15 +923,15 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
if (current_symbol != nullptr) {
std::vector<Address> addresses;

ConstString current_name =
current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
if (current_symbol->IsTrampoline()) {
ConstString trampoline_name =
current_symbol->GetMangled().GetName(Mangled::ePreferMangled);

if (current_name) {
if (trampoline_name) {
const ModuleList &images = target_sp->GetImages();

SymbolContextList code_symbols;
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeCode,
images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeCode,
code_symbols);
for (const SymbolContext &context : code_symbols) {
Address addr = context.GetFunctionOrSymbolAddress();
Expand All @@ -946,8 +945,8 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}

SymbolContextList reexported_symbols;
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeReExported,
reexported_symbols);
images.FindSymbolsWithNameAndType(
trampoline_name, eSymbolTypeReExported, reexported_symbols);
for (const SymbolContext &context : reexported_symbols) {
if (context.symbol) {
Symbol *actual_symbol =
Expand All @@ -969,7 +968,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}

SymbolContextList indirect_symbols;
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeResolver,
images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeResolver,
indirect_symbols);

for (const SymbolContext &context : indirect_symbols) {
Expand Down Expand Up @@ -1029,32 +1028,6 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
thread_plan_sp = std::make_shared<ThreadPlanRunToAddress>(
thread, load_addrs, stop_others);
}
// One more case we have to consider is "branch islands". These are regular
// TEXT symbols but their names end in .island plus maybe a .digit suffix.
// They are to allow arm64 code to branch further than the size of the
// address slot allows. We just need to single-instruction step in that
// case.
static const char *g_branch_island_pattern = "\\.island\\.?[0-9]*$";
static RegularExpression g_branch_island_regex(g_branch_island_pattern);

bool is_branch_island = g_branch_island_regex.Execute(current_name);
// FIXME: this is extra logging so I can figure out why this test is failing
// on the bot but not locally with all the same tools, etc...
if (thread_plan_sp && is_branch_island) {
if (log) {
StreamString s;
thread_plan_sp->GetDescription(&s, eDescriptionLevelVerbose);
LLDB_LOGF(log, "Am at a branch island, but already had plan: \n\t%s", s.GetData());
}
}
if (!thread_plan_sp && is_branch_island) {
thread_plan_sp = std::make_shared<ThreadPlanStepInstruction>(
thread,
/* step_over= */ false, /* stop_others */ false, eVoteNoOpinion,
eVoteNoOpinion);
LLDB_LOG(log, "Stepping one instruction over branch island: '{0}'.",
current_name);
}
} else {
LLDB_LOGF(log, "Could not find symbol for step through.");
}
Expand Down
16 changes: 0 additions & 16 deletions lldb/test/API/macosx/branch-islands/Makefile

This file was deleted.

72 changes: 0 additions & 72 deletions lldb/test/API/macosx/branch-islands/TestBranchIslands.py

This file was deleted.

6 changes: 0 additions & 6 deletions lldb/test/API/macosx/branch-islands/foo.c

This file was deleted.

6 changes: 0 additions & 6 deletions lldb/test/API/macosx/branch-islands/main.c

This file was deleted.

3 changes: 0 additions & 3 deletions lldb/test/API/macosx/branch-islands/padding1.s

This file was deleted.

3 changes: 0 additions & 3 deletions lldb/test/API/macosx/branch-islands/padding2.s

This file was deleted.

3 changes: 0 additions & 3 deletions lldb/test/API/macosx/branch-islands/padding3.s

This file was deleted.

3 changes: 0 additions & 3 deletions lldb/test/API/macosx/branch-islands/padding4.s

This file was deleted.

Loading