Skip to content

Conversation

@Prabhuk
Copy link
Contributor

@Prabhuk Prabhuk commented Jun 5, 2025

TestStopHookScripted.py Was failing for cases where -I 0 was not passed to stop-hook add calls.

@Prabhuk Prabhuk requested a review from JDevlieghere as a code owner June 5, 2025 23:52
@llvmbot llvmbot added the lldb label Jun 5, 2025
@Prabhuk Prabhuk removed the request for review from JDevlieghere June 5, 2025 23:52
@llvmbot
Copy link
Member

llvmbot commented Jun 5, 2025

@llvm/pr-subscribers-lldb

Author: Prabhu Rajasekaran (Prabhuk)

Changes

TestStopHookScripted.py Was failing for cases where -I 0 was not passed to stop-hook add calls.


Full diff: https://github.com/llvm/llvm-project/pull/143048.diff

1 Files Affected:

  • (modified) lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py (+6-6)
diff --git a/lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py b/lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
index b71f3421f9834..71f805e7f296b 100644
--- a/lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
+++ b/lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
@@ -58,19 +58,19 @@ def test_stop_hooks_scripted_no_entry(self):
 
     def test_stop_hooks_scripted_right_func(self):
         """Test that a scripted stop hook fires when there is a function match"""
-        self.stop_hooks_scripted(5, "-n step_out_of_me")
+        self.stop_hooks_scripted(5, "-I 0 -n step_out_of_me")
 
     def test_stop_hooks_scripted_wrong_func(self):
         """Test that a scripted stop hook doesn't fire when the function does not match"""
-        self.stop_hooks_scripted(0, "-n main")
+        self.stop_hooks_scripted(0, "-I 0 -n main")
 
     def test_stop_hooks_scripted_right_lines(self):
         """Test that a scripted stop hook fires when there is a function match"""
-        self.stop_hooks_scripted(5, "-f main.c -l 1 -e %d" % (self.main_start_line))
+        self.stop_hooks_scripted(5, "-I 0 -f main.c -l 1 -e %d" % (self.main_start_line))
 
     def test_stop_hooks_scripted_wrong_lines(self):
         """Test that a scripted stop hook doesn't fire when the function does not match"""
-        self.stop_hooks_scripted(0, "-f main.c -l %d -e 100" % (self.main_start_line))
+        self.stop_hooks_scripted(0, "-I 0 -f main.c -l %d -e 100" % (self.main_start_line))
 
     def test_stop_hooks_scripted_auto_continue(self):
         """Test that the --auto-continue flag works"""
@@ -89,9 +89,9 @@ def do_test_auto_continue(self, return_true):
         result = lldb.SBCommandReturnObject()
 
         if return_true:
-            command = "target stop-hook add -P stop_hook.stop_handler -k increment -v 5 -k return_false -v 1 -n step_out_of_me"
+            command = "target stop-hook add -I 0 -P stop_hook.stop_handler -k increment -v 5 -k return_false -v 1 -n step_out_of_me"
         else:
-            command = "target stop-hook add -G 1 -P stop_hook.stop_handler -k increment -v 5 -n step_out_of_me"
+            command = "target stop-hook add -I 0 -G 1 -P stop_hook.stop_handler -k increment -v 5 -n step_out_of_me"
 
         self.interp.HandleCommand(command, result)
         self.assertTrue(result.Succeeded(), "Set the target stop hook")

@github-actions
Copy link

github-actions bot commented Jun 5, 2025

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Collaborator

@jimingham jimingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand the failures that triggered this patch - stopping at the entry point somehow is at a place where both the function name filter for main and step_into_me pass - even though that should be the same stop-point for both checks. That seems quite odd.

But this test was not intending to test entry point behavior, so it's fine to exclude this for the purposes of this test.

You still have to fix the Python formatting but then this should be fine.

Prabhuk added 2 commits June 6, 2025 01:57
Test was failing for cases where -I 0 was not passed to stop-hook add calls.
@Prabhuk
Copy link
Contributor Author

Prabhuk commented Jun 6, 2025

I still don't understand the failures that triggered this patch - stopping at the entry point somehow is at a place where both the function name filter for main and step_into_me pass - even though that should be the same stop-point for both checks. That seems quite odd.

But this test was not intending to test entry point behavior, so it's fine to exclude this for the purposes of this test.

You still have to fix the Python formatting but then this should be fine.

Can we file a bug for this? If there are patches that you'd like me to try in our environment to address the bug I'll be happy to do so.

@Prabhuk Prabhuk merged commit 0a1fdbe into llvm:main Jun 6, 2025
7 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 6, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/23971

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/command_script_import.test (2982 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/json.test (2983 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/breakpoint_function_callback.test (2984 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test (2985 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/convenience_variables.test (2986 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Lua/persistent_state.test (2987 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/no_threadState.test (2988 of 2994)
UNSUPPORTED: lldb-shell :: ScriptInterpreter/Python/Crashlog/parser_text.test (2989 of 2994)
PASS: lldb-api :: terminal/TestEditlineCompletions.py (2990 of 2994)
UNRESOLVED: lldb-api :: tools/lldb-dap/launch/TestDAP_launch.py (2991 of 2994)
******************** TEST 'lldb-api :: tools/lldb-dap/launch/TestDAP_launch.py' FAILED ********************
Script:
--
/usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib --cmake-build-type Release -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/launch -p TestDAP_launch.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision 0a1fdbe4df326a237e775c81de37aa9ddbb714e0)
  clang revision 0a1fdbe4df326a237e775c81de37aa9ddbb714e0
  llvm revision 0a1fdbe4df326a237e775c81de37aa9ddbb714e0
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
Change dir to: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/launch
runCmd: settings clear --all

output: 

runCmd: settings set symbols.enable-external-lookup false

output: 

runCmd: settings set target.inherit-tcc true

output: 

runCmd: settings set target.disable-aslr false

output: 

runCmd: settings set target.detach-on-error false

output: 

runCmd: settings set target.auto-apply-fixits false

@Prabhuk Prabhuk deleted the lldb_test_fix branch October 21, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants