[all-commits] [llvm/llvm-project] 2b6c5b: [lldb-vscode] Implement RestartRequest
Jorge Gorbe Moya via All-commits
all-commits at lists.llvm.org
Tue May 2 14:51:28 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2b6c5bb995be1b675c1d92e2d46403c76764e5c7
https://github.com/llvm/llvm-project/commit/2b6c5bb995be1b675c1d92e2d46403c76764e5c7
Author: Jorge Gorbe Moya <jgorbe at google.com>
Date: 2023-05-02 (Tue, 02 May 2023)
Changed paths:
M lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
M lldb/source/API/SBProcess.cpp
A lldb/test/API/tools/lldb-vscode/restart/Makefile
A lldb/test/API/tools/lldb-vscode/restart/TestVSCode_restart.py
A lldb/test/API/tools/lldb-vscode/restart/TestVSCode_restart_runInTerminal.py
A lldb/test/API/tools/lldb-vscode/restart/main.c
M lldb/tools/lldb-vscode/VSCode.cpp
M lldb/tools/lldb-vscode/VSCode.h
M lldb/tools/lldb-vscode/lldb-vscode.cpp
Log Message:
-----------
[lldb-vscode] Implement RestartRequest
This is an optional request, but supporting it makes the experience
better when re-launching a big binary that takes significant time to
parse: instead of tearing down and re-create the whole session we just
need to kill the current process and launch a new one.
Some non-obvious comments that might help review this change:
* After killing the process, we get an "exited" event for it. Because
the process no longer exists some interesting things can occur that
manifest as flaky failures if not dealt with:
- `EventIsProcessEvent` relies on `SBEvent::GetBroadcasterClass`,
which can crash if the broadcaster is no longer there: the event
only holds a weak_ptr to its broadcaster, and `GetBroadcasterClass`
uses it without checking.
Other `EventIs*` functions look at the flavor of the EventData, so I
have modified EventIsProcessEvent to do that.
- We keep the PID of the old process so we can detect its "exited"
event and not terminate the whole session. But sometimes the
SBProcess we get from the event won't have a PID, for some reason.
* I have factored out the code to launch a process out to a new
LaunchProcess function, so it can be used from both `request_launch`
and `request_restart`.
* The restart_runInTerminal test has the same problem with debug builds
as the original runInTerminal test: when attaching to the launcher
instance of lldb-vscode it takes a long time to parse its debug info.
I have used the same workaround to disable that particular test for
debug builds.
Differential Revision: https://reviews.llvm.org/D147831
More information about the All-commits
mailing list