Skip to content

Commit b6922b7

Browse files
authored
Add more logging so I can figure out why TestBranchIslands.py is (llvm#139178)
failing but only on the bot.
1 parent abd5ee9 commit b6922b7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,15 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
10381038
static RegularExpression g_branch_island_regex(g_branch_island_pattern);
10391039

10401040
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+
}
10411050
if (!thread_plan_sp && is_branch_island) {
10421051
thread_plan_sp = std::make_shared<ThreadPlanStepInstruction>(
10431052
thread,

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Make sure that we can step in across an arm64 branch island
33
"""
44

5-
5+
import os
66
import lldb
77
import lldbsuite.test.lldbutil as lldbutil
88
from lldbsuite.test.lldbtest import *
@@ -32,6 +32,9 @@ def do_test(self):
3232
trace_before = lldbutil.print_stacktrace(thread, True)
3333
func_before = thread.frames[0].function
3434

35+
log_file_path = os.path.join(self.getBuildDir(), "step-log.txt")
36+
self.runCmd(f"log enable -f {log_file_path} lldb step")
37+
3538
thread.StepInto()
3639
stop_frame = thread.frames[0]
3740
# This is failing on the bot, but I can't reproduce the failure
@@ -59,6 +62,10 @@ def do_test(self):
5962
print(
6063
f"\nStop disassembly:\n {lldbutil.disassemble(target, stop_frame.function)}"
6164
)
65+
with open(log_file_path, "r") as f:
66+
data = f.read()
67+
print("Step Log:")
68+
print(data)
6269

6370
self.assertIn("foo", stop_frame.name, "Stepped into foo")
6471
var = stop_frame.FindVariable("a_variable_in_foo")

0 commit comments

Comments
 (0)