-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add more logging so I can figure out why TestBranchIslands.py is #139178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
failing but only on the bot.
@llvm/pr-subscribers-lldb Author: None (jimingham) Changesfailing but only on the bot. Full diff: https://github.com/llvm/llvm-project/pull/139178.diff 2 Files Affected:
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 578ab12268ea3..6c3040ef1a1da 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -1038,6 +1038,15 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
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,
diff --git a/lldb/test/API/macosx/branch-islands/TestBranchIslands.py b/lldb/test/API/macosx/branch-islands/TestBranchIslands.py
index c79840b400432..a8dd1886d5568 100644
--- a/lldb/test/API/macosx/branch-islands/TestBranchIslands.py
+++ b/lldb/test/API/macosx/branch-islands/TestBranchIslands.py
@@ -2,7 +2,7 @@
Make sure that we can step in across an arm64 branch island
"""
-
+import os
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
@@ -32,6 +32,9 @@ def do_test(self):
trace_before = lldbutil.print_stacktrace(thread, True)
func_before = thread.frames[0].function
+ log_file_path = os.path.join(self.getBuildDir(), "step-log.txt")
+ self.runCmd(f"log enable -f {log_file_path} lldb step")
+
thread.StepInto()
stop_frame = thread.frames[0]
# This is failing on the bot, but I can't reproduce the failure
@@ -59,6 +62,10 @@ def do_test(self):
print(
f"\nStop disassembly:\n {lldbutil.disassemble(target, stop_frame.function)}"
)
+ with open(log_file_path, "r") as f:
+ data = f.read()
+ print("Step Log:")
+ print(data)
self.assertIn("foo", stop_frame.name, "Stepped into foo")
var = stop_frame.FindVariable("a_variable_in_foo")
|
You can test this locally with the following command:darker --check --diff -r HEAD~1...HEAD lldb/test/API/macosx/branch-islands/TestBranchIslands.py View the diff from darker here.--- TestBranchIslands.py 2025-05-08 23:59:10.000000 +0000
+++ TestBranchIslands.py 2025-05-09 00:02:44.868955 +0000
@@ -32,11 +32,11 @@
trace_before = lldbutil.print_stacktrace(thread, True)
func_before = thread.frames[0].function
log_file_path = os.path.join(self.getBuildDir(), "step-log.txt")
self.runCmd(f"log enable -f {log_file_path} lldb step")
-
+
thread.StepInto()
stop_frame = thread.frames[0]
# This is failing on the bot, but I can't reproduce the failure
# locally. Let's see if we can dump some more info here to help
# figure out what went wrong...
|
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions cpp -- lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp View the diff from clang-format here.diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 6c3040ef1..def40205f 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -1044,7 +1044,8 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
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());
+ LLDB_LOGF(log, "Am at a branch island, but already had plan: \n\t%s",
+ s.GetData());
}
}
if (!thread_plan_sp && is_branch_island) {
|
jimingham
added a commit
to jimingham/from-apple-llvm-project
that referenced
this pull request
May 9, 2025
… is (llvm#139178)" This reverts commit b6922b7.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
failing but only on the bot.