Skip to content

Commit 74120d0

Browse files
authored
Revert branch island experiments (#139192)
This test is failing because when we step to what is the branch island address and ask for its symbol, we can't resolve the symbol, and just call it the last padding symbol plus a bajillion. That has nothing to do with the changes in this patch, but I'll revert this and keep trying to figure out why symbol reading on this bot is wrong.
1 parent 803fd73 commit 74120d0

File tree

9 files changed

+7
-146
lines changed

9 files changed

+7
-146
lines changed

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

+7-34
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "lldb/Target/Thread.h"
2727
#include "lldb/Target/ThreadPlanCallFunction.h"
2828
#include "lldb/Target/ThreadPlanRunToAddress.h"
29-
#include "lldb/Target/ThreadPlanStepInstruction.h"
3029
#include "lldb/Utility/DataBuffer.h"
3130
#include "lldb/Utility/DataBufferHeap.h"
3231
#include "lldb/Utility/LLDBLog.h"
@@ -924,15 +923,15 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
924923
if (current_symbol != nullptr) {
925924
std::vector<Address> addresses;
926925

927-
ConstString current_name =
928-
current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
929926
if (current_symbol->IsTrampoline()) {
927+
ConstString trampoline_name =
928+
current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
930929

931-
if (current_name) {
930+
if (trampoline_name) {
932931
const ModuleList &images = target_sp->GetImages();
933932

934933
SymbolContextList code_symbols;
935-
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeCode,
934+
images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeCode,
936935
code_symbols);
937936
for (const SymbolContext &context : code_symbols) {
938937
Address addr = context.GetFunctionOrSymbolAddress();
@@ -946,8 +945,8 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
946945
}
947946

948947
SymbolContextList reexported_symbols;
949-
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeReExported,
950-
reexported_symbols);
948+
images.FindSymbolsWithNameAndType(
949+
trampoline_name, eSymbolTypeReExported, reexported_symbols);
951950
for (const SymbolContext &context : reexported_symbols) {
952951
if (context.symbol) {
953952
Symbol *actual_symbol =
@@ -969,7 +968,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
969968
}
970969

971970
SymbolContextList indirect_symbols;
972-
images.FindSymbolsWithNameAndType(current_name, eSymbolTypeResolver,
971+
images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeResolver,
973972
indirect_symbols);
974973

975974
for (const SymbolContext &context : indirect_symbols) {
@@ -1029,32 +1028,6 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
10291028
thread_plan_sp = std::make_shared<ThreadPlanRunToAddress>(
10301029
thread, load_addrs, stop_others);
10311030
}
1032-
// One more case we have to consider is "branch islands". These are regular
1033-
// TEXT symbols but their names end in .island plus maybe a .digit suffix.
1034-
// They are to allow arm64 code to branch further than the size of the
1035-
// address slot allows. We just need to single-instruction step in that
1036-
// case.
1037-
static const char *g_branch_island_pattern = "\\.island\\.?[0-9]*$";
1038-
static RegularExpression g_branch_island_regex(g_branch_island_pattern);
1039-
1040-
bool is_branch_island = g_branch_island_regex.Execute(current_name);
1041-
// FIXME: this is extra logging so I can figure out why this test is failing
1042-
// on the bot but not locally with all the same tools, etc...
1043-
if (thread_plan_sp && is_branch_island) {
1044-
if (log) {
1045-
StreamString s;
1046-
thread_plan_sp->GetDescription(&s, eDescriptionLevelVerbose);
1047-
LLDB_LOGF(log, "Am at a branch island, but already had plan: \n\t%s", s.GetData());
1048-
}
1049-
}
1050-
if (!thread_plan_sp && is_branch_island) {
1051-
thread_plan_sp = std::make_shared<ThreadPlanStepInstruction>(
1052-
thread,
1053-
/* step_over= */ false, /* stop_others */ false, eVoteNoOpinion,
1054-
eVoteNoOpinion);
1055-
LLDB_LOG(log, "Stepping one instruction over branch island: '{0}'.",
1056-
current_name);
1057-
}
10581031
} else {
10591032
LLDB_LOGF(log, "Could not find symbol for step through.");
10601033
}

lldb/test/API/macosx/branch-islands/Makefile

-16
This file was deleted.

lldb/test/API/macosx/branch-islands/TestBranchIslands.py

-72
This file was deleted.

lldb/test/API/macosx/branch-islands/foo.c

-6
This file was deleted.

lldb/test/API/macosx/branch-islands/main.c

-6
This file was deleted.

lldb/test/API/macosx/branch-islands/padding1.s

-3
This file was deleted.

lldb/test/API/macosx/branch-islands/padding2.s

-3
This file was deleted.

lldb/test/API/macosx/branch-islands/padding3.s

-3
This file was deleted.

lldb/test/API/macosx/branch-islands/padding4.s

-3
This file was deleted.

0 commit comments

Comments
 (0)