Commit Graph

2896 Commits

Author SHA1 Message Date
Walter Erquinigo
d9ec4b24a8
[lldb-dap] Add an option to provide a format for stack frames (#71843)
When this option gets enabled, descriptions of stack frames will be
generated using the format provided in the launch configuration instead
of simply calling `SBFrame::GetDisplayFunctionName`. This allows
lldb-dap to show an output similar to the one in the CLI.
2023-11-13 21:10:16 -05:00
Brad Smith
9ba5b52c13
[lldb][test] Implement getting thread ID on OpenBSD (#71129) 2023-11-12 14:38:09 -05:00
David Spickett
2f8e3d55da
[lldb][AArch64][Linux] Add field information for the mte_ctrl register (#71808)
This is a Linux pseudo register provided by the NT_ARM_TAGGED_ADDR_CTRL
register set. It reflects the value passed to prctl
PR_SET_TAGGED_ADDR_CTRL.

https://docs.kernel.org/arch/arm64/memory-tagging-extension.html

The fields are made from the #defines the kernel provides for setting
the value. Its contents are constant so no runtime detection is needed
(once we've decided we have this register in the first place).

The permitted generated tags is technically a bitfield but at this time
we don't have a way to mark a field as preferring hex formatting.

```
(lldb) register read mte_ctrl
mte_ctrl = 0x000000000007fffb
         = (TAGS = 65535, TCF_ASYNC = 0, TCF_SYNC = 1, TAGGED_ADDR_ENABLE = 1)
```

(4 bit tags mean 16 possible tags, 16 bit bitfield)

Testing has been added to TestMTECtrlRegister.py, which needed a more
granular way to check for XML support, so I've added hasXMLSupport that
can be used within a test case instead of skipping whole tests if XML
isn't supported.

Same for the core file tests.
2023-11-10 09:01:22 +00:00
Daniel Thornburgh
17798ad7c3
[lldb] Use get-task-allow entitlement on macOS too (#71112)
Running the LLDB test suite in a GUI-less macOS environment (say, ssh)
requires that the debugged tasks be signed with the get-task-allow
entitlement.
2023-11-03 09:26:47 -07:00
David Spickett
b8150c8f12
[lldb][AArch64] Add SME2's ZT0 register (#70205)
SME2 is documented as part of the main SME supplement:
https://developer.arm.com/documentation/ddi0616/latest/

The one change for debug is this new ZT0 register. This register
contains data to be used with new table lookup instructions.
It's size is always 512 bits (not scalable) and can be
interpreted in many different ways depending on the instructions
that use it. 

The kernel has implemented this as a new register set containing
this single register. It always returns register data (with no header,
unlike ZA which does have a header).

https://docs.kernel.org/arch/arm64/sme.html

ZT0 is only active when ZA is active (when SVCR.ZA is 1). In the 
inactive state the kernel returns 0s for its contents. Therefore
lldb doesn't need to create 0s like it does for ZA. 

However, we will skip restoring the value of ZT0 if we know that
ZA is inactive. As writing to an inactive ZT0 sets SVCR.ZA to 1,
which is not desireable as it would activate ZA also. Whether
SVCR.ZA is set will be determined only by the ZA data we restore.

Due to this, I've added a new save/restore kind SME2. This is easier
than accounting for the variable length ZA in the SME data. We'll only
save an SME2 data block if ZA is active. If it's not we can get fresh
0s back from the kernel for ZT0 anyway so there's nothing for us to
restore.

This new register will only show up if the system has SME2 therefore
the SME set presented to the user may change, and I've had to account
for that in in a few places.

I've referred to it internally as simply "ZT" as the kernel does in
NT_ARM_ZT, but the architecture refers to the specific register as "ZT0"
so that's what you'll see in lldb.

```
(lldb) register read -s 6
Scalable Matrix Extension Registers:
      svcr = 0x0000000000000000
       svg = 0x0000000000000004
        za = {0x00 <...> 0x00}
       zt0 = {0x00 <...> 0x00}
```
2023-11-01 10:40:25 +00:00
David Spickett
dddd0c2501 [lldb][AArch64] Simplify AArch64SMEFA64 check
So we only have to read cpuinfo once.
2023-10-25 11:19:37 +01:00
David Spickett
e7012ba8d3
[lldb][AArch64] Add isAArch64SMEFA64 check to SME testing (#68094)
FEAT_SME_FA64 (smefa64 in Linux cpuinfo) allows the use of the full A64
instruction set while in streaming SVE mode.

See https://developer.arm.com/documentation/ddi0616/latest/ for details.

This means for example if we want to write to the ffr register during or
use floating point registers while in streaming mode, we need this
extension.

I initially was using QEMU which has it by default, and switched to
Arm's FVP which does not. So this change adds a more strict check and
converts most of the tests to use that. It would be possible in some
cases to avoid the offending instructions but it would be a lot of
effort and liable to fail randomly as the C library changes.

It is also my assumption that the majority of systems will have smefa64
as QEMU has chosen to have. If I turn out to be wrong, we can make the
effort to get the tests working without smefa64.

`isAArch64SME` remains for some tests, which are as follows:
* `test_aarch64_dynamic_regset_config` merely checks for the presence of
a register set, which appears for any SME system not just one with
smefa64.
* `test_aarch64_dynamic_regset_config_sme_za_disabled` only needs the ZA
register and does not enter streaming mode.
* `test_sme_not_present` tests for the absence of the SME register set,
so must be skipped if any form of SME is present.
* Various tests in `TestSVERegisters.py` need to know if SME is present
at all to generate an expected SVCR value. Earlier in the callstack
something else checked `isAArch64SMEFA64` already.
* `TestAArch64LinuxTLSRegisters.py` needs to test the `tpidr2` register
if any form of SME is present. msr/mrs instructions are used to do this
and are allowed even if smefa64 is not present.
2023-10-25 09:56:00 +01:00
Walter Erquinigo
10664813fc
[lldb-vscode] Allow specifying a custom escape prefix for LLDB commands (#69238)
We've been using the backtick as our escape character, however that
leads to a weird experience on VS Code, because on most hosts, as soon
as you type the backtick on VS Code, the IDE will introduce another
backtick. As changing the default escape character might be out of
question because other plugins might rely on it, we can instead
introduce an option to change this variable upon lldb-vscode
initialization.
FWIW, my users will be using : instead ot the backtick.
2023-10-25 00:05:54 -04:00
David Spickett
2a32afddf5
[lldb] Remove more references to lldb-vscode (#69696)
There are some uses of "vscode" in
`lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py` where
I'm not sure if it's referring to the adapter or VS Code itself, so
those remain.
2023-10-20 15:08:37 +01:00
Jonas Devlieghere
01263c6c6f
[lldb] Rename lldb-vscode to lldb-dap (#69264)
Rename lldb-vscode to lldb-dap. This change is largely mechanical. The
following substitutions cover the majority of the changes in this
commit:

  s/VSCODE/DAP/
  s/VSCode/DAP/
  s/vscode/dap/
  s/g_vsc/g_dap/

Discourse RFC:
https://discourse.llvm.org/t/rfc-rename-lldb-vscode-to-lldb-dap/74075/
2023-10-19 09:48:54 -07:00
Michael Buch
d579a1a24a
[lldb[test] TestCppUnionStaticMembers.py: XFAIL assertions on windows (#68408)
Split out the assertions that fail on Windows in preparation to
XFAILing them.

Drive-by change:
* Add a missing `self.build()` call in `test_union_in_anon_namespace`
* Fix formatting
* Add expectedFailureWindows decorator
2023-10-06 16:05:40 +01:00
Jonas Devlieghere
2da99a1119
[lldb] Expose Platform::Attach through the SB API (#68050)
Expose Platform::Attach through the SB API.

rdar://116188959
2023-10-03 10:34:00 -07:00
Jonas Devlieghere
111bc6f1fe
[lldb] Add config and decorator for wide character support in Editline (#66447)
Add a configuration entry for whether LLDB was configured with wide
character support in Editline and use it in a decorator to guard the
UTF-8 prompt test.
2023-09-14 22:16:24 -07:00
Jonas Devlieghere
019c8396c9
[lldb] Fix PExpectTest when using utf-8 as the encoding
PExpect 4.6, when using 'utf-8' throws a TypeError when trying to write
to the log file:

  File "llvm-project/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py", line 126, in _log
    self.logfile.write(s)
  TypeError: a bytes-like object is required, not 'str'

This looks like a bug in PExpect to me. Since the log file is only used
for tracing, work around the issue by disabling the log file when
specifying an encoding. This should fix the Debian bot [1] which runs
the test with tracing enabled (-t).

[1] https://lab.llvm.org/buildbot/#/builders/68/builds/59955
2023-09-13 20:33:47 -07:00
Jonas Devlieghere
850e90c47b
[lldb] Support Unicode in the prompt (#66312)
Account for Unicode when computing the prompt column width. Previously,
the string length (i.e. number of bytes) rather than the width of the
Glyph was used to compute the cursor position. The result was that the
cursor would be offset to the right when using a prompt containing
Unicode.
2023-09-13 20:08:05 -07:00
David Spickett
c8387a31a4
[lldb] Format more Python files with black (#65979)
By running this from lldb/

$ black --exclude "third_party/|scripts/|utils/" ./
2023-09-12 08:46:34 +01:00
David Spickett
6bf6c4762c Reland "[lldb] Improve completion tests (#65973)"
This reverts commit 8012518f60.

The x86 register write test had one that expected "\$rax" so on.
As these patterns were previously regex, the $ had to be escaped.
Now they are just plain strings to this is not needed.
2023-09-12 08:40:43 +01:00
Walter Erquinigo
a2a9918a85
[lldb-vscode] Make descriptive summaries and raw child for synthetics configurable (#65687)
"descriptive summaries" should only be used for small to medium binaries
because of the performance penalty the cause when completing types. I'm
defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well.
I'm defaulting it to false.

Both options can be set via a launch or attach config, following the
pattern of most settings. javascript extension wrappers can set these
settings on their own as well.
2023-09-11 17:00:01 -04:00
David Spickett
8012518f60 Revert "[lldb] Improve completion tests (#65973)"
This reverts commit 2378ba632e.

I need to fix the x86 specific register tests.
2023-09-11 17:35:27 +00:00
David Spickett
2378ba632e
[lldb] Improve completion tests (#65973)
* Assert no completions for tests that should not find completions.
* Remove regex mode from complete_from_to, which was unused.

This exposed bugs in 2 of the tests, target stop-hook and
process unload. These were fixed in previous commits but
couldn't be tested properly until this patch.
2023-09-11 18:26:51 +01:00
Alex Langford
e634c2f714 [lldb] Remove use of __future__ in python
These were useful primarily for the Python 2 to 3 transition. Python 2
is no longer supported so these are no longer necessary.

Differential Revision: https://reviews.llvm.org/D157759
2023-08-14 14:14:48 -07:00
John Harrison
ca71dc1b54 [lldb-vscode] Adding support for the "disassemble" request.
Instead of creating psuedo source files for each stack frame this change adopts the new DAP “disassemble” request, allowing clients to inspect assembly instructions of files with debug info in addition to files without debug info.

[[ https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disassemble | spec ]]

See attached screenshot of the disassembly view. {F28473848}

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D156493
2023-07-31 12:44:23 -04:00
John Harrison
3d1f89c2e3 [lldb-vscode] Creating a new flag for adjusting the behavior of evaluation repl expressions to allow users to more easily invoke lldb commands.
This adds a new flag and lldb runtime command to allow users to manage the behavior of the lldb-vscode evaluate repl request.

When evaluating a repl context this now has runtime managed flag for control how the repl behaviors with the follow values:

* `variable` - the existing behavior, with this mode requests are evaluted in the current frame context as variable expressions. To trigger a lldb command prefix an expression with ` and it will be evaluted as an lldb command.
* `command` - all expressions are evaluated as lldb commands.
* `auto` - An alternative mode that will attempt to determine if the expression is an lldb command or a variable expression. Based off the intepreted results the expression will be evaluted either as a command or an expression.

Additionally, I enabled completions and ensured they work with the new repl expression behavior to provide auto-completes.

This commit includes updates to the tests to verify the new behavior after the previous failures from submitting https://reviews.llvm.org/D154030.

Differential Revision: https://reviews.llvm.org/D155248
2023-07-19 21:04:12 +00:00
David Spickett
3ebd6f65cb [lldb][AArch64] Add test predicate for systems with SME enabled
"sme" is just one of many cpuinfo features for SME but it's the
only one we need for testing.

The rest are related to the use of certain instructions and
don't change the register state available.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D154823
2023-07-17 09:27:12 +01:00
Jim Ingham
01e3393b94 Split up the runCmd trace printing to print the command before running.
That way if the command crashes you still know what it was.

Differential Revision: https://reviews.llvm.org/D154752
2023-07-07 19:09:18 -07:00
John Harrison
227b2180eb Creating a startDebugging reverse DAP request handler in lldb-vscode.
Adds support for a reverse DAP request to startDebugging. The new request can be used to launch child processes from lldb scripts, for example it would be start forward to configure a debug configuration for a server and a client allowing you to launch both processes with a single debug configuraiton.

Reviewed By: wallace, ivanhernandez13

Differential Revision: https://reviews.llvm.org/D153447
2023-06-29 14:45:57 -04:00
Jim Ingham
f05e2fb013 Don't allow SBValue::Cast to cast from a smaller type to a larger,
as we don't in general know where the extra data should come from.

Differential Revision: https://reviews.llvm.org/D153657
2023-06-26 16:02:01 -07:00
Jonas Devlieghere
2238dcc393
[NFC][Py Reformat] Reformat python files in lldb
This is an ongoing series of commits that are reformatting our Python
code. Reformatting is done with `black` (23.1.0).

If you end up having problems merging this commit because you have made
changes to a python file, the best way to handle that is to run `git
checkout --ours <yourfile>` and then reformat it with black.

RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Differential revision: https://reviews.llvm.org/D151460
2023-05-25 12:54:09 -07:00
Jorge Gorbe Moya
d25fb4e90c [lldb-vscode] Make tests not wait for 'launch' process events if launch fails.
After https://reviews.llvm.org/D147831, lldb-vscode doesn't send a
process event after launch/attach in case of failure. I believe this is
the right interpretation of the spec, because the description of the
event says:

> The event indicates that the debugger has begun debugging a new
> process.

and we haven't started debugging a process if there's no process because
we failed to launch it. This is also supported by the fact that
`request_launch` in vscode.py doesn't wait for the event if passed
`expectFailure=True`. However, this doesn't take into account
*unexpected* launch failures. In that case, `request_launch` will hang
indefinitely waiting for the process event.

This patch changes it so we'll only wait for these events if
`request["success"]` is true, independently of whether any failure was
expected or not.

Differential Revision: https://reviews.llvm.org/D150470
2023-05-22 10:41:11 -07:00
Muhammad Omair Javaid
039b28e14e [LLDB] Fix TestDataFormatterSynthVal.py for AArch64/Windows
Since 44363f2 various tests have started passing but introduced a
expression evaluation failure in TestDataFormatterSynthVal.py.
This patch marks the expression evaluation part as skipped while rest
of the test passes.
This patch aslo introduces a new helper isAArch64Windows in lldbtest.py.
2023-05-16 00:14:20 +04:00
Jorge Gorbe Moya
1b11034c67 [lldb-vscode] Fix handling of RestartRequest arguments.
According to the spec, RestartRequest has an optional "arguments" field, which
is a RestartArguments object. RestartArguments has its own optional "arguments"
field, which is a (LaunchRequestArguments | AttachRequestArguments) object. So
we need to to the "arguments" lookup twice to get to the actual launch
arguments.

Differential Revision: https://reviews.llvm.org/D150392
2023-05-11 13:11:38 -07:00
Jorge Gorbe Moya
2b6c5bb995 [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
2023-05-02 14:50:39 -07:00
Med Ismail Bennani
34bd15798e [lldb/test] Update lldbutil.fetch_next_event to match broadcaster class
This patch updates the `lldbutil.fetch_next_event` helper function to
either match a specific broadcaster or match a whole broadcaster class.

This is very handy when testing process events for interactive scripted
process debugging.

This also fixes a bug in the failing case, where `SBEvent.GetDescription`
expects a `SBStream` argument. We never took that code path in the
original implementation so we didn't hit that bug.

Differential Revision: https://reviews.llvm.org/D149175

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-04-25 15:03:45 -07:00
Jorge Gorbe Moya
53aa22cd9a [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
2023-04-10 18:18:05 -07:00
Adrian Prantl
a78997e0aa Simplify test.
This test doesn't actually depend on being able to launch the process.
This may or may not explain why this test behaves oddly on some of our bots.
2023-04-04 15:16:01 -07:00
Jonas Devlieghere
fda53ad937
[lldb] Support Universal Mach-O binaries with a fat64 header
Support universal Mach-O binaries with a fat64 header. After
4d683f7fa7, dsymutil can now generate such binaries when the offsets
would otherwise overflow the 32-bit offsets in the regular fat header.

rdar://107289570

Differential revision: https://reviews.llvm.org/D147012
2023-03-28 15:46:26 -07:00
Jonas Devlieghere
0016f476ab
[lldb] Remove errant call to SBReproducer.SetWorkingDirectory
The old reproducer functionality has been removed. Remove this call as
it's now just a NO-OP.
2023-03-24 17:32:58 -07:00
Fangrui Song
ccc2f362db Android.rules: remove mips* rules
They have been obsoleted for a long time and D146565 recently removed
Clang support.
2023-03-23 15:58:43 -07:00
Felipe de Azevedo Piovezan
c640a146c4 [lldb] Explicitly set libcxx paths when USE_SYSTEM_STDLIB is provided
For tests marked as "USE_SYSTEM_STDLIB", the expectation is that the
system's standard library should be used. However, the implementation of
this flag is such that we simply don't pass _any_ libcxxx-related flags
to Clang; in turn, Clang will use its defaults.

For a Clang/Libcxx pair compiled together, Clang defaults to:
1. The headers of the sibling libcxx.
2. The libraries of the system.

This mismatch is actually a bug in the driver; once fixed, however, (2)
would point to the sibling libcxx as well, which is _not_ what test
authors intended with the USE_SYSTEM_STDLIB flag.

As such, this patch explicitly sets a path to the system's libraries.
This change is done only in Apple platforms so that we can test this
works in this case first.

Differential Revision: https://reviews.llvm.org/D146714
2023-03-23 11:53:13 -04:00
Adrian Vogelsgesang
8aa3137551 [LLDB] Do not dereference promise pointer in coroutine_handle pretty printer
So far, the pretty printer for `std::coroutine_handle` internally
dereferenced the contained frame pointer displayed the `promise`
as a sub-value. As noticed in https://reviews.llvm.org/D132624
by @labath, this can lead to an endless loop in lldb during printing
if the coroutine frame pointers form a cycle.

This commit breaks the cycle by exposing the `promise` as a pointer
type instead of a value type. The depth to which the `frame variable`
and the `expression` commands dereference those pointers can be
controlled using the `--ptr-depth` argument.

Differential Revision: https://reviews.llvm.org/D132815
2023-01-31 07:40:31 -08:00
Jordan Rupprecht
dd9b31e2c2 [test] Remove unused unittest2 import from concurrent_base.py 2023-01-26 18:23:23 -08:00
Jason Molenda
484bc2bcc7 Run cmdline address expressions through ABI's FixAddress
On systems like ARM, where the non-addressable bits of a pointer
value may be used for metadata (ARMv8.3 pointer authentication, or
Type Byte Ignore), those bits need to be cleared before the address
points to a valid memory location.  Add a call to the target's ABI
to clear those from address expression arguments to the lldb
commands (e.g. `disassemble -a`).

Differential Revision: https://reviews.llvm.org/D141629
2023-01-23 10:44:19 -08:00
Greg Clayton
fc743f034a Report which modules have forcefully completed types in statistics.
A previous patch added the ability for us to tell if types were forcefully completed. This patch adds the ability to see which modules have forcefully completed types and aggregates the number of modules with forcefully completed types at the root level.

We add a module specific setting named "debugInfoHadIncompleteTypes" that is a boolean value. We also aggregate the number of modules at the root level that had incomplete debug info with a key named "totalModuleCountWithIncompleteTypes" that is a count of number of modules that had incomplete types.

Differential Revision: https://reviews.llvm.org/D138638
2022-11-30 21:22:27 -08:00
Pavel Labath
6335deb68b [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()
Previously, we just used the platform name. This worked mostly OK, but
it required adding special handling for any unusual (and potentially
downstream) platform plugins, as evidenced by the hardcoding of the
qemu-user platform.

The current implementation was added in
D121605/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d, which this essentially
reverts and goes back to the previous method of retrieving the platform
name from the platform triple (the "OS" field).

The motivation for D121605 was the ability to retrieve the process
without constructing an SBDebugger object (which would be necessary in a
world where SBPlatforms are managed by SBDebuggers). However, this world
did not arrive (mainly due to other commitments on my part), and I now
think that if we do want to go in that direction, that we should just
create a dummy/empty SBDebugger object for holding the initial
SBPlatform.

One benefit of D121605 was the unification of getPlatform and
getHostPlatform code paths, and I preserve that benefit by unifying them
in the other direction -- using the host SBPlatform for getHostPlatform.

Differential Revision: https://reviews.llvm.org/D138430
2022-11-29 11:29:58 +01:00
Jason Molenda
f6d4e68717 Revert "[LLDB] Do not dereference promise pointer in coroutine_handle pretty printer"
This reverts commit cd3091a88f.

This change crashes on macOS systems in
formatters::StdlibCoroutineHandleSyntheticFrontEnd when
it fails to create the `ValueObjectSP promise` and calls
a method on it.  The failure causes a segfault while running
TestCoroutineHandle.py on the "LLDB Incremental" CI bot,
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/

This change originally landed via https://reviews.llvm.org/D132815
2022-11-25 12:22:58 -08:00
Pavel Labath
14aace34c3 Revert "Add runToBinaryEntry option for lldb-vscode"
This reverts commit f0c16f8912 because it
breaks linux and mac bots.
2022-11-23 13:26:11 +01:00
Jeffrey Tan
f0c16f8912 Add runToBinaryEntry option for lldb-vscode
This patch adds a new runToBinaryEntry option which sets a one-shot breakpoint
at program entry. This option is useful for synchronizing module loading with
dynamic loader to measure debugger startup performance:  when program entry
one-short breakpoint hits most of the dependency modules should have been
loaded so this provides a good sample point for debugger startup time.

More explicitly for lldb-vscode, when this option is enabled, "Initialized" DAP
event is synchronously sent after most dependency modules are loaded.

Differential Revision: https://reviews.llvm.org/D135798
2022-11-22 13:52:45 -08:00
Adrian Vogelsgesang
cd3091a88f [LLDB] Do not dereference promise pointer in coroutine_handle pretty printer
So far, the pretty printer for `std::coroutine_handle` internally
dereferenced the contained frame pointer displayed the `promise`
as a sub-value. As noticed in https://reviews.llvm.org/D132624
by @labath, this can lead to an endless loop in lldb during printing
if the coroutine frame pointers form a cycle.

This commit breaks the cycle by exposing the `promise` as a pointer
type instead of a value type. The depth to which the `frame variable`
and the `expression` commands dereference those pointers can be
controlled using the `--ptr-depth` argument.

Differential Revision: https://reviews.llvm.org/D132815
2022-11-20 14:26:36 -08:00
Jordan Rupprecht
8be41c787f [test] Allow skipTestIfFn to apply to entire classes for skipIfNoSBHeaders
Some test cases are already marked @skipIfNoSBHeaders, but they make use of SBAPI headers in test setup. The setup will fail if the headers are missing, so it is too late to wait until the test case to apply the skip annotation.

In addition to allowing this to apply to entire classes, I also changed all the existing annotations from test cases to test classes where necessary/appropriate.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D138181
2022-11-17 08:17:10 -08:00
Pavel Labath
22887ff964 Revert "Send statistics in initialized event"
The test is failing on linux.

This reverts commits 7fe3586cda and
d599ac41aa.
2022-11-16 12:20:21 +01:00