Skip to content

[lldb][Windows] Preserve breakpoint locations across process exit#212219

Open
charles-zablit wants to merge 1 commit into
llvm:mainfrom
charles-zablit:cz/lldb/windows/switch-to-false
Open

[lldb][Windows] Preserve breakpoint locations across process exit#212219
charles-zablit wants to merge 1 commit into
llvm:mainfrom
charles-zablit:cz/lldb/windows/switch-to-false

Conversation

@charles-zablit

Copy link
Copy Markdown
Contributor

ProcessWindows::OnExitProcess unloads the executable module with delete_locations=true, which deletes the target's breakpoint locations when the debuggee exits. Other platforms keep them, so inspecting a breakpoint after the process died returns no location on Windows.

Pass delete_locations=false to match the other platforms.

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

Changes

ProcessWindows::OnExitProcess unloads the executable module with delete_locations=true, which deletes the target's breakpoint locations when the debuggee exits. Other platforms keep them, so inspecting a breakpoint after the process died returns no location on Windows.

Pass delete_locations=false to match the other platforms.


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

2 Files Affected:

  • (modified) lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp (+1-1)
  • (modified) lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py (-1)
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 2aac8dfde2c7b..561710ccec3c8 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -612,7 +612,7 @@ void ProcessWindows::OnExitProcess(uint32_t exit_code) {
     ModuleSP executable_module = target->GetExecutableModule();
     ModuleList unloaded_modules;
     unloaded_modules.Append(executable_module);
-    target->ModulesDidUnload(unloaded_modules, true);
+    target->ModulesDidUnload(unloaded_modules, false);
   }
 
   SetExitStatus(exit_code, /*exit_string=*/"");
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index 4c8c90bc81f97..65ca990365654 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -10,7 +10,6 @@
 
 
 class BreakpointLocationsTestCase(TestBase):
-    @expectedFailureWindowsAndNoLLDBServer(bugnumber="llvm.org/pr24528")
     def test_enable(self):
         """Test breakpoint enable/disable for a breakpoint ID with multiple locations."""
         self.build()

@github-actions

Copy link
Copy Markdown

🐧 Linux x64 Test Results

  • 34129 tests passed
  • 506 tests skipped
  • 1 test failed

Failed Tests

(click on a test name to see its output)

lldb-api

lldb-api.functionalities/gdb_remote_client/TestGdbClientModuleLoad.py
Script:
--
/usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib --env LLVM_INCLUDE_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include --env LLVM_TOOLS_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin --libcxx-include-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/c++/v1 --libcxx-include-target-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/x86_64-unknown-linux-gnu/c++/v1 --libcxx-library-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/x86_64-unknown-linux-gnu --triple x86_64-unknown-linux-gnu --build-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build --lldb-module-cache-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build/module-cache-lldb/lldb-api --clang-module-cache-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build/module-cache-clang/lldb-api --executable /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lldb --lldb-python-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/local/lib/python3.12/dist-packages --compiler /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang --dsymutil /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin --lldb-obj-root /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb --lldb-libs-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib --cmake-build-type Release /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/functionalities/gdb_remote_client -p TestGdbClientModuleLoad.py
--
Exit Code: 1

Command Output (stdout):
--
Skipping the following test categories: msvcstl, dsym, pdb, gmodules, debugserver, objc

--
Command Output (stderr):
--
PASS: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_android_app_process (TestGdbClientModuleLoad.TestGdbClientModuleLoad.test_android_app_process)

--- FileCheck trace (code=1) ---
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestGdbClientModuleLoad.py -check-prefix=VDSO

FileCheck input:
[  0] 98FC07B8 0x0000000000ef0000 [vdso] (0xef0000)
[  1] 75B11BBB-EF8B-5645-B9B1-A7261EC8ABCF-05413284 0x0000000000ed8ed0 /home/gha/actions-runner/bin/Runner.Worker 


FileCheck output:

/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestGdbClientModuleLoad.py:151:10: error: VDSO: expected string not found in input
 # VDSO: [ 0] {{.*}} 0x0000000000ee0000 {{.*}}module_load
         ^
<stdin>:1:1: note: scanning from here
[ 0] 98FC07B8 0x0000000000ef0000 [vdso] (0xef0000)
^

Input file: <stdin>
Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestGdbClientModuleLoad.py

-dump-input=help explains the following input dump.

Input was:
<<<<<<
             1: [ 0] 98FC07B8 0x0000000000ef0000 [vdso] (0xef0000) 
check:151'0    {                                                     search range start (exclusive)
check:151'1                                                          error: no match found in search range
             2: [ 1] 75B11BBB-EF8B-5645-B9B1-A7261EC8ABCF-05413284 0x0000000000ed8ed0 /home/gha/actions-runner/bin/Runner.Worker  
check:151'2                                                                                                                       } search range end (exclusive)
>>>>>>



FAIL: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_vdso (TestGdbClientModuleLoad.TestGdbClientModuleLoad.test_vdso)
Log Files:
 - /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build/functionalities/gdb_remote_client/TestGdbClientModuleLoad/Failure_test_vdso.log
======================================================================
FAIL: test_vdso (TestGdbClientModuleLoad.TestGdbClientModuleLoad.test_vdso)
   This test checks vdso loading in the situation where the process does
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestGdbClientModuleLoad.py", line 150, in test_vdso
    self.filecheck("image list", __file__, "-check-prefix=VDSO")
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2760, in filecheck
    self.assertEqual(cmd_status, 0)
AssertionError: 1 != 0
Config=x86_64-/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang
----------------------------------------------------------------------
Ran 2 tests in 0.146s

FAILED (failures=1)

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

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.

1 participant