[🍒 release/6.1.1] [lldb] Clear thread name container before writing UTF8 bytes (#134150) #10696
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.
Explanation:
Clear out the thread name container before refilling it to avoid triggering an assertion that the target string container is empty in
llvm::convertUTF16ToUTF8String
.Scope:
This change is trivial. Either the string container was already empty, in which case clearing it does nothing, or it was not empty, in which case clearing it prevents a crash.
Issues:
[lldb] [Windows] Lldb-dap crashes when trying to step over breakpoint llvm/llvm-project#133904
Original PRs:
[lldb] Clear thread name container before writing UTF8 bytes llvm/llvm-project#134150
Risk:
Very low risk. This code is Windows only and the change is small, easy to understand, and fixes a known crash that has been observed by users.
Testing:
No additional testing on this release specifically, but the fix has been verified externally: https://forums.swift.org/t/lldb-crashes-during-vs-code-debug-session-on-windows-10/79902/3
Reviewers:
@compnerd
(cherry picked from commit be3abfc)