[lldb-vscode] Fix two issues with runInTerminal test.
authorJorge Gorbe Moya <jgorbe@google.com>
Fri, 7 Apr 2023 20:34:16 +0000 (13:34 -0700)
committerJorge Gorbe Moya <jgorbe@google.com>
Tue, 11 Apr 2023 01:18:05 +0000 (18:18 -0700)
commit53aa22cd9ac4a779208cf9907354cc6d4211e783
tree3133b154f19ad9784ff15f891dced8adab73908a
parenta0a141fcbe1dfd35032fa5c052e6906180a37fb1
[lldb-vscode] Fix two issues with runInTerminal test.

With ptrace_scope = 1 the kernel only allows tracing descendants of a
process. When using runInTerminal, the target process is not launched
by the debugger, so we need to modify LaunchRunInTerminal to explicitly
allow tracing. This should fix a problem reported in
https://reviews.llvm.org/D84974#3903716

In order to allow only the main lldb-vscode process to attach to the
target, this change introduces a new `--debugger-pid` flag that needs
to be passed with `--launch-target` and `--comm-file`.

Also, remove a special case from the launch method in the
lldbvscode_testcase test harness. The existing test was using
stopOnEntry, so the first stop didn't happen at the expected breakpoint
unless the harness did configurationDone first.

Differential Revision: https://reviews.llvm.org/D147805
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
lldb/tools/lldb-vscode/JSONUtils.cpp
lldb/tools/lldb-vscode/JSONUtils.h
lldb/tools/lldb-vscode/Options.td
lldb/tools/lldb-vscode/lldb-vscode.cpp