summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities
AgeCommit message (Collapse)Author
2025-11-20[lldb] Fix a test if hardware breakpoints are not supported (#168813)Igor Kudrin
If `HardwareBreakpointTestBase.supports_hw_breakpoints()` returns False, `SimpleHWBreakpointTest.does_not_support_hw_breakpoints()` returns None, so the test runs and fails. However, it should be skipped instead. The test was added in #146602, while `supports_hw_breakpoints()` was changed in #146609, which was landed earlier despite having a bigger number.
2025-11-19[lldb][test] Correctly skip a test on a 32-bit target (#168631)Igor Kudrin
The test was added in #147252. On a 32-bit target, it fails with error: ``` File "...\TestDataFormatterLibcxxInvalidString.py", line 23, in test self.skip() ^^^^^^^^^ AttributeError: 'LibcxxInvalidStringDataFormatterTestCase' object has no attribute 'skip' ```
2025-11-13[lldb] Add libstdcpp initializer_list formatter (#167515)Ebuka Ezike
Make the existing libc++ formatter generic Add initializer_list summary provider. Add test for `libstdcpp`
2025-11-12Revert "[lldb] Introduce ScriptedFrameProvider for real threads" (#167662)Michael Buch
The new test fails on x86 and arm64 public macOS bots: ``` 09:27:59 ====================================================================== 09:27:59 FAIL: test_append_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can add frames after real stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 122, in test_append_frames 09:27:59 self.assertEqual(new_frame_count, original_frame_count + 1) 09:27:59 AssertionError: 5 != 6 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_applies_to_thread (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that applies_to_thread filters which threads get the provider. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 218, in test_applies_to_thread 09:27:59 self.assertEqual( 09:27:59 AssertionError: 5 != 1 : Thread with ID 1 should have 1 synthetic frame 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_prepend_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can add frames before real stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 84, in test_prepend_frames 09:27:59 self.assertEqual(new_frame_count, original_frame_count + 2) 09:27:59 AssertionError: 5 != 7 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_remove_frame_provider_by_id (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that RemoveScriptedFrameProvider removes a specific provider by ID. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 272, in test_remove_frame_provider_by_id 09:27:59 self.assertEqual(thread.GetNumFrames(), 3, "Should have 3 synthetic frames") 09:27:59 AssertionError: 5 != 3 : Should have 3 synthetic frames 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_replace_all_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can replace the entire stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 41, in test_replace_all_frames 09:27:59 self.assertEqual(thread.GetNumFrames(), 3, "Should have 3 synthetic frames") 09:27:59 AssertionError: 5 != 3 : Should have 3 synthetic frames 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_scripted_frame_objects (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that provider can return ScriptedFrame objects. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 159, in test_scripted_frame_objects 09:27:59 self.assertEqual(frame0.GetFunctionName(), "custom_scripted_frame_0") 09:27:59 AssertionError: 'thread_func(int)' != 'custom_scripted_frame_0' 09:27:59 - thread_func(int) 09:27:59 + custom_scripted_frame_0 09:27:59 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ---------------------------------------------------------------------- 09:27:59 Ran 6 tests in 14.242s 09:27:59 09:27:59 FAILED (failures=6) ``` Reverts llvm/llvm-project#161870
2025-11-11[libunwind] Fix execution flow imbalance when using C++ Exceptions (#165066)Med Ismail Bennani
2025-11-11[lldb] Introduce ScriptedFrameProvider for real threads (#161870)Med Ismail Bennani
This patch extends ScriptedFrame to work with real (non-scripted) threads, enabling frame providers to synthesize frames for native processes. Previously, ScriptedFrame only worked within ScriptedProcess/ScriptedThread contexts. This patch decouples ScriptedFrame from ScriptedThread, allowing users to augment or replace stack frames in real debugging sessions for use cases like custom calling conventions, reconstructing corrupted frames from core files, or adding diagnostic frames. Key changes: - ScriptedFrame::Create() now accepts ThreadSP instead of requiring ScriptedThread, extracting architecture from the target triple rather than ScriptedProcess.arch - Added SBTarget::RegisterScriptedFrameProvider() and ClearScriptedFrameProvider() APIs, with Target storing a SyntheticFrameProviderDescriptor template for new threads - Added "target frame-provider register/clear" commands for CLI access - Thread class gains LoadScriptedFrameProvider(), ClearScriptedFrameProvider(), and GetFrameProvider() methods for per-thread frame provider management - New SyntheticStackFrameList overrides FetchFramesUpTo() to lazily provide frames from either the frame provider or the real stack This enables practical use of the SyntheticFrameProvider infrastructure in real debugging workflows. rdar://161834688 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-11-11[lldb][test] Fix ThreadStepUntilAPI.pyDavid Spickett
After #167359 / 95db31e7f69e7008f0c570ed30d54d1e418e10f2. A fix was attempted in #167423 but was not quite enough. From what I could understand, in v1 format you have to specify all the basic blocks. Where before !call_me implied they were all cold (I think, very shaky understanding here). For this test we want to see blocks like call_me/foo/call_me. So adding a line for block 1 fixes the tests. It could produce more blocks at some point but I think as long as foo is within two of them, it'll be fine.
2025-11-10[LLDB] Fix lldb failure caused by 95db31e7f6. (#167423)Rahman Lavaee
2025-11-10[lldb] Fix TestLocationsAfterRebuild test (#167402)GeorgeHuyubo
After commit fce58897ce82 enabled the locate_module callback for main executables, the TestLocationsAfterRebuild.py test started failing on remote platforms. The test was hardcoded to expect breakpoint location "1.3" to exist after three rebuilds, but the new module loading behavior changed how breakpoint locations are managed. This patch fixes the test by: - Removing the @skipIfRemote decorator to re-enable testing on remote platforms - Dynamically querying the actual number of breakpoint locations instead of assuming a specific count - Using loc.GetID() to get actual location IDs rather than assuming sequential IDs (1, 2, 3) - Iterating through all valid locations and verifying each can be disabled/enabled The fix maintains the original test intent (validating that breakpoint location IDs remain valid after rebuilds) while adapting to the new module loading behavior where the number and IDs of locations may vary across platforms. Co-authored-by: George Hu <georgehuyubo@gmail.com>
2025-11-10[lldb] Disable TestLocationsAfterRebuild for remote targets (#167239)Dmitry Vasilyev
#160199 broke buildbots `lldb-remote-linux-ubuntu` and `lldb-remote-linux-win`. This patch must make these buildbots green for now.
2025-11-07[lldb] Correctly detach (rather than kill) when connecting with gdb-remote ↵Jonas Devlieghere
(#166869) We weren't setting `m_should_detach` when going through the `DoConnectRemote` code path. This meant that when you would attaches to a remote process with `gdb-remote <port>` and use Ctrl+D, it would kill the process instead of detach from it. rdar://156111423
2025-11-07[LLDB] Run MSVC STL string(-view) tests with PDB (#166833)nerix
PDB doesn't include the typedefs for types, so all types use their full name. For `std::string` and friends, this means they show up as `std::basic_string<char, std::char_traits<char>, std::allocator<char>>`. This PR updates the `std::{,w,u8,u16,u32}string(_view)` tests to account for this and runs them with PDB.
2025-11-06[LLDB] Run working STL data formatter tests with PDB (#166812)nerix
This enables testing with PDB for all tests that don't require any changes to pass. I ran the `lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic` tests locally and they passed.
2025-10-31[LLDB][NativePDB] Estimate symbol sizes (#165727)nerix
In #165604, a test was skipped on Windows, because the native PDB plugin didn't set sizes on symbols. While the test isn't compiled with debug info, it's linked with `-gdwarf`, causing a PDB to be created on Windows. This PDB will only contain the public symbols (written by the linker) and section information. The symbols themselves don't have a size, however the DIA SDK sets a size for them. It seems like, for these data symbols, the size given from DIA is the distance to the next symbol (or the section end). This PR implements the naive approach for the native plugin. The main difference is in function/code symbols. There, DIA searches for a corresponding `S_GPROC32` which have a "code size" that is sometimes slightly smaller than the difference to the next symbol.
2025-10-30[NFCI][lldb][test] Fix mismatched C/C++ substitutions (#165773)Raul Tambre
Most of the cases were where a C++ file was being compiled with the C substitution. There were a few cases of the opposite though. LLDB seems to be the only real culprit in the LLVM codebase for these mismatches. Rest of the LLVM presumably sticks at least language-specific options in the common substitutions making the mistakes immediately apparent. I found these by using Clang frontend configuration files containing language-specific options for both C and C++ (e.g. `-std=c2y` and `-std=c++26`).
2025-10-30[lldb][test] Fix libc++ API tests on older Clang versionsMichael Buch
Both of these fail on our Clang-19 macOS bots.
2025-10-29[LLDB] Skip TestMultipleSlides.py on Windows (#165604)nerix
After the default PDB plugin changed to the native one (#165363), this test failed, because it uses the size of public symbols and the native plugin sets the size to 0 (as PDB doesn't include this information explicitly). A PDB was built because the final executable in that test was linked with `-gdwarf`.
2025-10-27[lldb] Fix TestVTableValue.py test_overwrite_vtable test (#164910)Daniel Sanders
Some machines have read-only vtables but this test expects to overwrite them. Use -no_data_const to ensure the vtable is writable
2025-10-21[lldb][test] Fix TestEmptyFuncThreadStepOut.py (#161788)Igor Kudrin
The test did not work as intended when the empty function `done()` contained prologue/epilogue code, because a breakpoint was set before the last instruction of the function, which caused the test to pass even with the fix from #126838 having been reverted. The test is intended to check a case when a breakpoint is set on a return instruction, which is the very last instruction of a function. When stepping out from this breakpoint, there is interaction between `ThreadPlanStepOut` and `ThreadPlanStepOverBreakpoint` that could lead to missing the stop location in the outer frame; the detailed explanation can be found in #126838. On `Linux/AArch64`, the source is compiled into: ``` > objdump -d main.o 0000000000000000 <done>: 0: d65f03c0 ret ``` So, when the command `bt set -n done` from the original test sets a breakpoint to the first instruction of `done()`, this instruction luckily also happens to be the last one. On `Linux/x86_64`, it compiles into: ``` > objdump -d main.o 0000000000000000 <done>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 5d pop %rbp 5: c3 ret ``` In this case, setting a breakpoint by function name means setting it several instructions before `ret`, which does not provoke the interaction between `ThreadPlanStepOut` and `ThreadPlanStepOverBreakpoint`.
2025-10-21[lldb] Add bidirectional packetLog to gdbclientutils.py (#162176)Daniel Sanders
While debugging the tests for #155000 I found it helpful to have both sides of the simulated gdb-rsp traffic rather than just the responses so I've extended the packetLog in MockGDBServerResponder to record traffic in both directions. Tests have been updated accordingly
2025-10-20Fix a potential use-after-free in StopInfoBreakpoint. (#163471)jimingham
StopInfoBreakpoint keeps a BreakpointLocationCollection for all the breakpoint locations at the BreakpointSite that was hit. It is also lives through the time a given thread is stopped, so there are plenty of opportunities for one of the owning breakpoints to get deleted. But BreakpointLocations don't keep their owner Breakpoints alive, so if the BreakpointLocationCollection can live past when some code gets a chance to delete an owner breakpoint, and then you ask that location for some breakpoint information, it will access freed memory. This wasn't a problem before PR #158128 because the StopInfoBreakpoint just kept the BreakpointSite that was hit, and when you asked it questions, it relooked up that list. That was not great, however, because if you hit breakpoints 5 & 6, deleted 5 and then asked which breakpoints got hit, you would just get 6. For that and other reasons that PR changed to storing a BreakpointLocationCollection of the breakpoints that were hit. That's better from a UI perspective but caused this potential problem. I fix it by adding a variant of the BreakpointLocationCollection that also holds onto a shared pointer to the Breakpoints that own the locations that were hit, thus keeping them alive till the StopInfoBreakpoint goes away. This fixed the ASAN assertion. I also added a test that works harder to cause trouble by deleting breakpoints during a stop.
2025-10-13[lldb] Remove obsolete comment in TestCortexMExceptionUnwindJason Molenda
2025-10-13[lldb][API test] TestCortexMExceptionUnwind needs ARM llvm targetJason Molenda
Finally figured out the issue with TestCortexMExceptionUnwind.py failing on some CI. When the llvm is configured without the ARM target enabled, the ARM ABI plugins will not be initialized in lldb, and the unwind engine won't backtrace more than one stack frame. This test requires that the ARM target be enabled in the llvm cmake. Update the decorator to specify that; should be the end of these mysterious fails.
2025-10-13[LLDB] Check type before creating `std::atomic` synthetic children (#163176)nerix
From https://github.com/llvm/llvm-project/pull/163077#issuecomment-3396435083: Currently, `std::atomic<T>` will always use the MSVC STL synthetic children and summary. When inspecting types from other STLs, the output would not show any children. This PR adds a check that `std::atomic` contains `_Storage` to be classified as coming from MSVC's STL.
2025-10-10[lldb][NFC] enable unwind logging in TestCortexMExceptionUnwindJason Molenda
Still seeing a failure on a CI bot with this test that I cannot reproduce locally, but luckily this one CI bot is giving me trace output from the tests. Turn on the unwind log when tracing is enabled, migth get a better hint what's up with this test fail.
2025-10-09[lldb] Cortex-M exception unwind API test cleanupJason Molenda
This test, with a corefile created via yaml2macho-core plus an ObjectFileJSON binary with symbol addresses and ranges, was failing on some machines/CI because the wrong ABI was being picked. The bytes of the functions were not included in the yaml or .json binary. The unwind falls back to using the ABI plugin default unwind plans. We have two armv7 ABIs - the Darwin ABI that always uses r7 as the frame pointer, and the AAPCS ABI which uses r11 code. In reality, armv7 code uses r11 in arm mode, r7 in thumb code. But the ABI ArchDefaultUnwindPlan doesn't have any access to the Target's ArchSpec or Process register state, to determine the correct processor state (arm or thumb). And in fact, on Cortex-M targets, the instructions are always thumb, so the arch default unwind plan (hardcoded r11) is always wrong. The corefile doesn't specify a vendor/os, only a cpu. The object file json specifies the armv7m-apple-* triple, which will select the correct ABI plugin, and the test runs. In some cases, it looks like the Process ABI was fetched after opening the corefile, but before the binary.json was loaded and corrected the Target's ArchSpec. And we never re-evaluate the ABI once it is set, in a Process. When we picked the AAPCS armv7 ABI, we would try to use r11 as frame pointer, and the unwind would stop after one stack frame. I'm stepping around this problem by (1) adding the register bytes of the prologues of every test function in the backtrace, and (2) shortening the function ranges (in binary.json) to specify that the functions are all just long enough for the prologue where execution is stopped. The instruction emulation plugin will fail if it can't get all of the bytes from the function instructions, so I hacked the function sizes in the .json to cover the prologue plus one and changed the addresses in the backtrace to fit within those ranges. [ updated this commit to keep the @skipIfRemote on the API test because two remote CI bots are failing for reasons I don't quite see. ]
2025-10-09Add a scripted way to re-present a stop location (#158128)jimingham
This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327
2025-10-08[lldb] Fix stepping out if the return address is not allowed to stop at ↵Igor Kudrin
(#161982) When a thread reaches a breakpoint at the return address set by `ThreadPlanStepOut`, `ThreadPlanStepOut::ShouldStop()` calls `ThreadPlanShouldStopHere::InvokeShouldStopHereCallback()`, and if it returns `false`, `ThreadPlanShouldStopHere::QueueStepOutFromHerePlan()` is called to queue a new plan to skip the corresponding range. Once the new plan finishes, `ThreadPlanStepOut::ShouldStop()` should recheck the stop condition; however, there is no code path in the method that sets `done` to `true`. Before #126838, if `done` was `false`, the method checked if a suitable frame had been reached. After the patch, the check is only performed at a breakpoint; thus, the execution continues. This patch causes `ThreadPlanStepOut::ShouldStop()` to recheck the stop condition when `m_step_out_further_plan_sp` completes.
2025-10-08Revert "[lldb] Cortex-M exception unwind API test cleanup" (#162520)Vladislav Dzhidzhoev
This reverts commit 01a8f9b81870ac9bfe26d80fa3313d56cb8cbe13. The reason is "lldb-remote-linux-win" buildbot breakage (https://lab.llvm.org/buildbot/#/builders/197/builds/9625).
2025-10-07[lldb] Cortex-M exception unwind API test cleanupJason Molenda
This test, with a corefile created via yaml2macho-core plus an ObjectFileJSON binary with symbol addresses and ranges, was failing on some machines/CI because the wrong ABI was being picked. The bytes of the functions were not included in the yaml or .json binary. The unwind falls back to using the ABI plugin default unwind plans. We have two armv7 ABIs - the Darwin ABI that always uses r7 as the frame pointer, and the AAPCS ABI which uses r11 code. In reality, armv7 code uses r11 in arm mode, r7 in thumb code. But the ABI ArchDefaultUnwindPlan doesn't have any access to the Target's ArchSpec or Process register state, to determine the correct processor state (arm or thumb). And in fact, on Cortex-M targets, the instructions are always thumb, so the arch default unwind plan (hardcoded r11) is always wrong. The corefile doesn't specify a vendor/os, only a cpu. The object file json specifies the armv7m-apple-* triple, which will select the correct ABI plugin, and the test runs. In some cases, it looks like the Process ABI was fetched after opening the corefile, but before the binary.json was loaded and corrected the Target's ArchSpec. And we never re-evaluate the ABI once it is set, in a Process. When we picked the AAPCS armv7 ABI, we would try to use r11 as frame pointer, and the unwind would stop after one stack frame. I'm stepping around this problem by (1) adding the register bytes of the prologues of every test function in the backtrace, and (2) shortening the function ranges (in binary.json) to specify that the functions are all just long enough for the prologue where execution is stopped. The instruction emulation plugin will fail if it can't get all of the bytes from the function instructions, so I hacked the function sizes in the .json to cover the prologue plus one and changed the addresses in the backtrace to fit within those ranges.
2025-10-02[lldb][test] Un-XFAIL TestDataFormatterStdUnorderedMap.py for older Clang ↵Michael Buch
versions Fixed in https://github.com/llvm/llvm-project/pull/156033
2025-10-01[lldb][RISCV] Fixed TestSymbolFileJSON for RISC-V (#161497)Georgiy Samoylov
This test failed during testing on the RISC-V target because we couldn't strip the main label from the binary. main is dynamically linked when the -fPIC flag is enabled. The RISC-V ABI requires that executables support loading at arbitrary addresses to enable shared libraries and secure loading (ASLR). In PIC mode, function addresses cannot be hardcoded in the code. Instead, code is generated to load addresses from the GOT/PLT tables, which are initialized by the dynamic loader. The reference to main thus ends up in .dynsym and is dynamically bound. We cannot strip main or any other dynamically linked functions because these functions are referenced indirectly via dynamic linking tables (.plt and .got). Removing these symbols would break the dynamic linking mechanism needed to resolve function addresses at runtime, causing the executable to fail to correctly call them.
2025-10-01[LLDB] Add load core time to target metrics (#161581)Jacob Lalonde
This patch adds a load core time, right now we don't have much insight into the performance of load core, especially for large coredumps. To start collecting information on this I've added some minor instrumentation code to measure the two call sites of `LoadCore`. I've also added a test to validate the new metric is output in statistics dump
2025-09-25[lldb][test] Refactor and expand TestMemoryRegionDirtyPages.py (#156035)David Spickett
This started as me being annoyed that I got loads of this when inspecting memory regions on Mac: Modified memory (dirty) page list provided, 0 entries. So I thought I should test the existing behaviour, which led me to refactor the existing test to run the same checks on all regions. In the process I realised that the output is not wrong. There is a difference between knowing that no pages are dirty and not knowing anything about dirty pages. We print that there are 0 entries so the user knows that difference. The test case now checks "memory region" output as well as API use. There were also some checks only run on certain regions, like page size, which now run for all of them.
2025-09-18[lldb] Fix unsafe map mutation in ProcessElfCore::FindModuleUUID (#159444)David Peixotto
The `ProcessElfCore::FindModuleUUID` function can be called by multiple threads at the same time when `target.parallel-module-load` is true. We were using the `operator[]` to lookup the UUID which will mutate the map when the key is not present. This is unsafe in a multi-threaded contex so we now use a read-only `find` operation and explicitly return an invalid UUID when the key is not present. The `m_uuids` map can follow a create-then-query pattern. It is populated in the `DoLoadCore` function which looks like it is only called in a single-threaded context so we do not need extra locking as long as we keep the other accesses read-only. Other fixes I considered * Use a lock to protect access - We don't need to modify the map after creation so we can allow concurrent read-only access. * Store the map in a const pointer container to prevent accidental mutation in other places. - Only accessed in one place currently so just added a comment. * Store the UUID in the NT_FILE_Entry after building the mapping correctly in `UpdateBuildIdForNTFileEntries`. - The map lets us avoid a linear search in `FindModuleUUID`. This commit also reverts the temporary workaround from #159395 which disabled parallel module loading to avoid the test failure. Fixes #159377
2025-09-17[lldb][test] Disable parallel module loading for TestNetBSDCore.py (#159395)David Spickett
Since #157170 this test has been flakey on several LLDB buildbots. I suspect it's to do with mutli-threading, there are more details in #159377. Disable parallel loading for now so we are not spamming people making unrelated changes.
2025-09-16[LLDB] [Tests] Downgrade -Wincompatible-pointer-types to a warning in some ↵Sirraide
tests (#158756) These no longer compile because the warning now defaults to an error after #157364, so downgrade the error to a warning for now; I’m not familiar enough with either LLDB or MacOS to fix these warnings properly (assuming they’re unintended).
2025-09-15[Clang] [Sema] Make `-Wincompatible-pointer-types` an error by default (#157364)Sirraide
GCC 14 also made this an error by default, so we’re following suit. Fixes #74605
2025-09-15[lldb][test] Fix unordered-map test. (#158286)Ebuka Ezike
The build step is overidden so it uses `libstdc++` instead of `libc++` on linux
2025-09-11[lldb][NFC] Mark API test skipIfRemote to avoid a botJason Molenda
The lldb-remote-linux-ubuntu bot (and only this bot) is still failing for TestCortexMExceptionUnwind.py because the Target triple is somehow inheriting a non-Darwin OS. I marked this API test skipUnlessDarwin but this bot can be identified more specifically by a skipIfRemote test. There's no benefit to running this test remotely anyway; it doesn't execute any code.
2025-09-10Revert "[lldb][NFC] Force some logging on to TestCortexMExceptionUnwind.py"Jason Molenda
This reverts commit 336503c4e1cdb5eaefde0536a34f0a95bc0c57bf.
2025-09-10[lldb][NFC] Force some logging on to TestCortexMExceptionUnwind.pyJason Molenda
to possibly debug why this test fails on the lldb-remote-linux-ubuntu CI bot. I'm sure the Target ArchSpec is somehow ending up _not_ armv7m-apple-* like it should be, but I'd like to gather a little more info before I just give up on running this test on linux systems.
2025-09-10Revert "[lldb][NFC] Try to adapt Cortex-M API test for an Unbuntu bot"Jason Molenda
This reverts commit 4eadb45f83cef00165055f8038f179ca5c3e88ef.
2025-09-10[lldb][NFC] Try to adapt Cortex-M API test for an Unbuntu botJason Molenda
When I added support for the Cortex-M exception return unwinding, I got CI test failures on the lldb-remote-linux-ubuntu bot. The triple from my test `binary.json`, "armv7m-apple", was not being used for the Target, so the incorrect SysV / AAPCS ABI was being selected, and that ABI plugin has default unwind plans that hardcode the arm-code r11 frame pointer behavior. This is a Cortex-M core, and r7 should be used. The Darwin Arm ABI plugin uses r7 for both arm and thumb, and behaves correctly. Try getting the triple from `binary.json` in the API test, creating the target with that triple explicitly before loading the corefile. This may help prevent however we were losing the "-apple-" part of the triple. We'll see what the CI bot looks like with this added.
2025-09-10[lldb][test] skip test `TestRerunAndExprDylib.py` on remote (#157916)Ebuka Ezike
2025-09-10[lldb][test] Re-enable `TestRerunAndExprDylib.py` (#157872)Ebuka Ezike
the `skipTestIfFn` requires a function that return a string to skip or None to run the test. The `isUbuntu18_04` function returns a bool and the test is skipped on all platforms. https://github.com/llvm/llvm-project/blob/25ebdfe0ab202a6cb30232d84bc5838439fd67d5/lldb/packages/Python/lldbsuite/test/decorators.py#L145-L157
2025-09-10[lldb][test] StepUntil disable test for unsupported linkers. (#157474)Ebuka Ezike
`INSERT BEFORE` keyword is not supported in current versions gold and mold linkers. Since we cannot confirm accurately what linker and version is available on the system and when it will be supported. We test it with a sample program using the script keywords.
2025-09-09[lldb][NFC] Update testsuite skip commentJason Molenda
to explain why the skip was added.
2025-09-09[lldb] Skip TestCortexMExceptionUnwind except DarwinJason Molenda
I'm getting a failure on one linux CI, lldb-remote-linux-ubuntu, where the test of assertEqual(thread.GetNumFrames(), 6) fails because the unwinder only has one frame, most likely the target triple is not set to armv7m-apple-* so ABISysV_arm is being used instead of ABIMacOSX_arm and the architecture default unwind plans behave differently. Possibly the frame pointer register, or possibly the way the arch default unwind plans are structured. Skipping on linux for now until I can debug further. Can repo on Darwin by changing the binary.json `"triple": "armv7m-apple"` to armv7m-linux.
2025-09-09NFC: SBThread should not be the one to compute StopReasonData. (#157577)jimingham
This is something the StopInfo class manages, so it should be allowed to compute this rather than having SBThread do so. This code just moves the computation to methods in StopInfo. It is mostly NFC. The one change that I actually had to adjust the tests for was a couple of tests that were asking for the UnixSignal stop info data by asking for the data at index 1. GetStopInfoDataCount returns 1 and we don't do 1 based indexing so the test code was clearly wrong. But I don't think it makes sense to perpetuate handing out the value regardless of what index you pass us.