1399 Commits

Author SHA1 Message Date
Jonas Devlieghere
4714215efb
[lldb] Support true/false in ValueObject::SetValueFromCString (#115780)
Support "true" and "false" (and "YES" and "NO" in Objective-C) in
ValueObject::SetValueFromCString.

Fixes #112597
2024-11-12 21:18:22 -08:00
Dave Lee
60e3a81c42
[lldb] Add builtin e alias for expression (#115359)
The changes in 461f859a72 (llvm/llvm-project#65974) resulted in a change
in behavior not just for completion, but also for selection of inexect
commands.

Since many use `e` to mean `expression`, this change adds an alias for
`e`. Note that the referenced change similarly aliases `h` to `help`.
2024-11-07 11:24:00 -08:00
David Spickett
d8139ae50f [lldb][test] Use -gdwarf to fix same CU breakpoint test on Windows on Arm
clang when given -g on Windows produces a PDB file. For whatever reason,
the test doesn't work with that.

-gdwarf produces DWARF regardless of platform.

Fixes 803f957e87e4083f6d61c8991171eeeaf0e6bd61.
2024-11-06 11:40:42 +00:00
David Spickett
9f8c3d3796 [lldb][test] Correct typo in breakpoint test file name
Added by https://github.com/llvm/llvm-project/pull/114896.
2024-11-06 10:43:21 +00:00
jimingham
803f957e87
Fix a thinko in the CallSite handling code: (#114896)
I have to check for the sc list size being changed by the call-site
search, not just that it had more than one element.

Added a test for multiple CU's with the same name in a given module,
which would have caught this mistake.

We were also doing all the work to find call sites when the found decl
and specified decl's only difference was a column, but the incoming
specification hadn't specified a column (column number == 0).
2024-11-05 11:23:23 -08:00
jimingham
23a01a413d
More refinement of call site handling in stepping. (#114628)
When you set a "next branch breakpoint" and run to it while stepping,
you have to claim the stop at that breakpoint to be the top of the
inlined call stack, or you will seem to "step in" and then plans might
try to step back out again.

This records the PrefferedLineEntry for next branch breakpoints and adds
a test to make sure this works.
2024-11-05 10:33:24 -08:00
Michael Buch
eee8718e26 [lldb][test] TestDataFormatterLibcxxOptionalSimulator.py: skip on Clang-17
A Clang change introduced in this version breaks this test. Said
change was reverted in `52a9ba7ca4fb9427706c28bb3ca15f7a56eecf3f`
in newer versions of Clang.
2024-11-04 11:23:11 +00:00
David Spickett
7557972884 [lldb][test] Fix formatting in TestInlineStepping.py
Fixes a218f0f354e9df2ce689686be503f3d85fea44f9
2024-10-31 09:08:00 +00:00
jimingham
a218f0f354
[lldb][test] Skip one inline stepping test for arm-ubuntu. (#114295)
The test is currently passing everywhere but this 32-bit arm ubuntu bot.
I don't have an easy way to debug this, so I'm skipping the test on that
platform till we get a chance to figure this out.
2024-10-31 09:06:42 +00:00
jimingham
3243e3d887
Fix stepping away from the bottom-most frame of a virtual inlined call stack. (#114337)
The computation of 'Thread::IsVirtualStep" was wrong - it called being
at the bottom of a virtual call stack a "virtual step" but that is
actually when you've gotten to concrete code and need to step for real.

I also added a test for this.
2024-10-30 18:26:38 -07:00
jimingham
7dbbd2b251
Fix call site breakpoint patch (#114158)
This fixes the two test suite failures that I missed in the PR:

https://github.com/llvm/llvm-project/pull/112939

One was a poorly written test case - it assumed that on connect to a
gdb-remote with a running process, lldb MUST have fetched all the frame
0 registers. In fact, there's no need for it to do so (as the CallSite
patch showed...) and if we don't need to we shouldn't. So I fixed the
test to only expect a `g` packet AFTER calling read_registers.

The other was a place where some code had used 0 when it meant
LLDB_INVALID_LINE_NUMBER, which I had fixed but missed one place where
it was still compared to 0.
2024-10-30 09:28:38 -07:00
Adrian Prantl
eac2c182c6
Remove a flaky and unnecessary check (#114251)
The order in which the libraries appear is not always stable and even if
it were, this test is not the right place to check for this.
2024-10-30 08:59:08 -07:00
jimingham
b54bc104ea
Revert "Add the ability to break on call-site locations, improve inli… (#113947)
…ne stepping (#112939)"

This was breaking some gdb-remote packet counting tests on the bots. I
can't see how this patch could cause that breakage, but I'm reverting to
figure that out.

This reverts commit f14743794587db102c6d1b20f9c87a1ac20decfd.
2024-10-28 11:52:32 -07:00
jimingham
f147437945
Add the ability to break on call-site locations, improve inline stepping (#112939)
Previously lldb didn't support setting breakpoints on call site
locations. This patch adds that ability.

It would be very slow if we did this by searching all the debug
information for every inlined subroutine record looking for a call-site
match, so I added one restriction to the call-site support. This change
will find all call sites for functions that also supply at least one
line to the regular line table. That way we can use the fact that the
line table search will move the location to that subsequent line (but
only within the same function). When we find an actually moved source
line match, we can search in the function that contained that line table
entry for the call-site, and set the breakpoint location back to that.

When I started writing tests for this new ability, it quickly became
obvious that our support for virtual inline stepping was pretty buggy.
We didn't print the right file & line number for the breakpoint, and we
didn't set the position in the "virtual inlined stack" correctly when we
hit the breakpoint. We also didn't step through the inlined frames
correctly. There was code to try to detect the right inlined stack
position, but it had been refactored a while back with the comment that
it was super confusing and the refactor was supposed to make it clearer,
but the refactor didn't work either.

That code was made much clearer by abstracting the job of "handling the
stack readjustment" to the various StopInfo's. Previously, there was a
big (and buggy) switch over stop info's. Moving the responsibility to
the stop info made this code much easier to reason about.

We also had no tests for virtual inlined stepping (our inlined stepping
test was actually written specifically to avoid the formation of a
virtual inlined stack... So I also added tests for that along with the
tests for setting the call-site breakpoints.
2024-10-28 10:01:57 -07:00
Liu An
911a6f2fcc
[lldb][LoongArch64] Add support for LoongArch64 in elf-core for lldb (#112296)
When using the lldb command 'target create --core' on the LoongArch64
architecture, this part of the code is required.
2024-10-21 10:04:55 +01:00
Luke Drummond
b55c52c047 Revert "Renormalize line endings whitespace only after dccebddb3b80"
This reverts commit 9d98acb196a40fee5229afeb08f95fd36d41c10a.
2024-10-18 21:16:50 +01:00
Jacob Lalonde
5033ea73bb
[LLDB][Minidump] Add breakpoint stop reasons to the minidump. (#108448)
Recently my coworker @jeffreytan81 pointed out that Minidumps don't show
breakpoints when collected. This was prior blocked because Minidumps
could only contain 1 exception, now that we support N signals/sections
we can save all the threads stopped on breakpoints.
2024-10-17 15:26:05 -07:00
Luke Drummond
9d98acb196 Renormalize line endings whitespace only after dccebddb3b80
Line ending policies were changed in the parent, dccebddb3b80. To make
it easier to resolve downstream merge conflicts after line-ending
policies are adjusted this is a separate whitespace-only commit. If you
have merge conflicts as a result, you can simply `git add --renormalize
-u && git merge --continue` or `git add --renormalize -u && git rebase
--continue` - depending on your workflow.
2024-10-17 14:49:26 +01:00
Stefan Gränitz
3ef630ac33
[lldb] Support tests with nested make invocations on Windows 2/2 (#112360)
Following up from https://github.com/llvm/llvm-project/pull/112342, we
roll out the fix and quote nested `make` invocations in all API tests.
2024-10-16 13:07:02 +02:00
Stefan Gränitz
a4367d2d13
[lldb] Support tests with nested make invocations on Windows 1/2 (#112342)
In recent PR https://github.com/llvm/llvm-project/pull/111531 for
Windows support, we enabled tests that require the `make` tool. On
Windows, default install directories likely contain spaces, in this case
e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically
handled well by CMake, so that today invocations from `dotest.py` don't
cause issues. However, we also have nested invocations from a number of
Makefiles themselves. These still failed if the path to the `make` tool
contains spaces.

This patch attempts to fix the functionalities/completion test by adding
quotes in the respective Makefile. If it keeps passing on the bots, we can
roll out the fix to all affected tests.
2024-10-15 14:22:12 +02:00
David Spickett
d941254da9 [lldb][test] Fix var name typo in TestProcessSaveCoreMinidump 2024-10-11 11:00:07 +00:00
Jason Molenda
3bef742559 Revert "[lldb] Implement basic support for reverse-continue (#99736)"
Reverting this again; I added a commit which added @skipIfDarwin
markers to the TestReverseContinueBreakpoints.py and
TestReverseContinueNotSupported.py API tests, which use lldb-server
in gdbserver mode which does not work on Darwin.  But the aarch64 ubuntu
bot reported a failure on TestReverseContinueBreakpoints.py,
https://lab.llvm.org/buildbot/#/builders/59/builds/6397

  File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py", line 63, in test_reverse_continue_skip_breakpoint
    self.reverse_continue_skip_breakpoint_internal(async_mode=False)
  File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py", line 81, in reverse_continue_skip_breakpoint_internal
    self.expect(
  File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2372, in expect
    self.runCmd(
  File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1002, in runCmd
    self.assertTrue(self.res.Succeeded(), msg + output)
AssertionError: False is not true : Process should be stopped due to history boundary
Error output:
error: Process must be launched.

This reverts commit 4f297566b3150097de26c6a23a987d2bd5fc19c5.
2024-10-10 16:24:38 -07:00
Jason Molenda
4f32077814 Revert "[lldb] skip ReverseContinue tests on Darwin"
This reverts commit c686eeb7fcc89673909e7e1f0a0a09a0da269d28.
2024-10-10 16:24:38 -07:00
Jason Molenda
c686eeb7fc [lldb] skip ReverseContinue tests on Darwin
This uses lldb-server in gdbserver mode, which requires a ProcessNative
plugin.  Darwin does not have a ProcessNative plugin; it uses
debugserver instead of lldb-server.  Skip these tests.
2024-10-10 16:08:19 -07:00
Robert O'Callahan
4f297566b3 [lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`) providing
support for the `bc` and `bs` packets. `lldb-server` does not support
those packets, and there is no plan to change that. So, for testing
purposes, `lldbreverse.py` wraps `lldb-server` with a Python
implementation of *very limited* record-and-replay functionality for use
by *tests only*.

The majority of this PR is test infrastructure (about 700 of the 950
lines added).
2024-10-10 16:08:19 -07:00
Jacob Lalonde
e9c8f75d45
[LLDB][Minidump] Have Minidumps save off and properly read TLS data (#109477)
This patch adds the support to `Process.cpp` to automatically save off
TLS sections, either via loading the memory region for the module, or
via reading `fs_base` via generic register. Then when Minidumps are
loaded, we now specify we want the dynamic loader to be the `POSIXDYLD`
so we can leverage the same TLS accessor code as `ProcessELFCore`. Being
able to access TLS Data is an important step for LLDB generated
minidumps to have feature parity with ELF Core dumps.
2024-10-10 15:59:51 -07:00
Augusto Noronha
2ff4c25b7e Revert "[lldb] Implement basic support for reverse-continue (#99736)"
This reverts commit d5e1de6da96c1ab3b8cae68447e8ed3696a7006e.
2024-10-10 15:05:58 -07:00
Robert O'Callahan
d5e1de6da9
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`) providing
support for the `bc` and `bs` packets. `lldb-server` does not support
those packets, and there is no plan to change that. So, for testing
purposes, `lldbreverse.py` wraps `lldb-server` with a Python
implementation of *very limited* record-and-replay functionality for use
by *tests only*.

The majority of this PR is test infrastructure (about 700 of the 950
lines added).
2024-10-10 13:01:47 -07:00
Vladislav Dzhidzhoev
058ede06c4
[lldb][test] Use xcrun -f strip for API tests on Darwin (#111842)
A follow-up for https://github.com/llvm/llvm-project/pull/111816.

This is to fix buildbot failure
https://lab.llvm.org/staging/#/builders/195/builds/4242.

TestSymbolFileJSON.py doesn't pass with llvm-strip on macOS. Apparently,
llvm-strip/llvm-objcopy can't clean symbols from Mach-O nlists.
2024-10-10 17:14:13 +02:00
David Spickett
ec009994a0 [lldb][test] Remove xfails from static lib tests on Windows
Originally failing due to https://github.com/llvm/llvm-project/issues/24901,
but since https://github.com/llvm/llvm-project/pull/110837 the
test is passing.

Already removed one xfail but didn't realise we had more for
the same bug.
2024-10-08 08:58:43 +00:00
David Spickett
7c1087613b [lldb][test] Fix unexpected pass of TestBSDArchives on Windows
Originally failing due to https://github.com/llvm/llvm-project/issues/24901,
but since https://github.com/llvm/llvm-project/pull/110837 the
test is passing.

https://lab.llvm.org/buildbot/#/builders/141/builds/3012

My guess is that the `llvm-` tool has better support for static
libraries on Windows.
2024-10-08 08:56:21 +00:00
Michael Buch
5e7cc37422 [lldb][test] TestDataFormatterLibcxxOptionalSimulator.py: don't use __builtin_printf
This caused Windows CI to fail with:
```
Build Command Output:

make: Entering directory 'C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.test_r0'

"C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang++.exe"  -std=c++11 -gdwarf -O0   -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make/../../../../..//include -IC:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb/include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\data-formatter\data-formatter-stl\libcxx-simulators\optional -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make -include C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make/test_common.h -fno-limit-debug-info    -fno-exceptions -D_HAS_EXCEPTIONS=0 -fms-compatibility-version=19.0 -std=c++14  -DREVISION=0 -std=c++14 --driver-mode=g++ -MT main.o -MD -MP -MF main.d -c -o main.o C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\data-formatter\data-formatter-stl\libcxx-simulators\optional/main.cpp

C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe main.o -gdwarf -O0   -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make/../../../../..//include -IC:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb/include -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\data-formatter\data-formatter-stl\libcxx-simulators\optional -IC:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make -include C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\make/test_common.h -fno-limit-debug-info     -fuse-ld=lld  --driver-mode=g++ -o "a.out"

lld-link: error: undefined symbol: printf

>>> referenced by main.o:(main)

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [Makefile.rules:515: a.out] Error 1

make: Leaving directory 'C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.test_r0'
```
2024-10-07 17:38:14 +02:00
Vladislav Dzhidzhoev
0e8a10b099
[lldb][test] Mark test() in TestBSDArchives.py as passing remotely (#111199)
It was xfail'ed in de2ddc8f3146b. However, it passes on a buildbot
https://lab.llvm.org/staging/#/builders/195/builds/3988.
2024-10-07 17:37:44 +02:00
Pavel Labath
0e2970f0ad
[lldb] Make libc++ simulator tests compatible with category-based ski… (#111353)
…pping, which works by setting a field on the function object. This
doesn't work on a functools.partial object. Use a real function instead.
2024-10-07 16:53:26 +02:00
Michael Buch
a1c0ba1646 [lldb][test] TestDataFormatterLibcxxOptionalSimulator.py: change order of ifdefs
The current layout *does* have `removecv_t`. So change
the ifdefs to reflect that.
2024-10-07 11:12:01 +01:00
Michael Buch
66713a0f82
[lldb][test] Add libcxx-simulators test for std::optional (#111133)
Follow-up to the LLDB std::optional data-formatter test failure caused
by https://github.com/llvm/llvm-project/pull/110355.

Two formats are supported:
1. `__val_` has type `value_type`
2. `__val_`'s type is wrapped in `std::remove_cv_t`
2024-10-07 11:01:56 +01:00
Michael Buch
d148548779
Reland "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout" (#111123)
Relands https://github.com/llvm/llvm-project/pull/108375 which had to be
reverted because it was failing on the Windows buildbot. Trying to
reland this with `msvc::no_unique_address` on Windows.
2024-10-07 10:58:57 +01:00
Michael Buch
ee4dd147ba Revert "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout (#108375)"
This reverts commit d5f6e886ff0df8265d44ab0646afcb4a06e6475a.

Caused failure on Windows CI. Following test failed:
```
Config=aarch64-C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe

======================================================================

FAIL: test_r5_c2_ALTERNATE_LAYOUT (TestDataFormatterLibcxxStringSimulator.LibcxxStringDataFormatterSimulatorTestCase.test_r5_c2_ALTERNATE_LAYOUT)

    partial(func, *args, **keywords) - new function with partial application

----------------------------------------------------------------------

Traceback (most recent call last):

  File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\data-formatter\data-formatter-stl\libcxx-simulators\string\TestDataFormatterLibcxxStringSimulator.py", line 23, in _run_test

    self.expect_var_path("longstring", summary='"I am a very long string"')

  File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 2552, in expect_var_path

    value_check.check_value(self, eval_result, str(eval_result))

  File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 321, in check_value

    test_base.assertEqual(

AssertionError: '"I am a very long string"' != '""'

- "I am a very long string"

+ ""

 : (std::__lldb::string) longstring = ""

Checking SBValue: (std::__lldb::string) longstring = ""
```

We may need to use `msvc::no_unique_address` around the simulators.
2024-10-03 14:59:47 +01:00
Michael Buch
d5f6e886ff
[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout (#108375)
Depends on https://github.com/llvm/llvm-project/pull/108362 and
https://github.com/llvm/llvm-project/pull/108343.

Adds new layout for https://github.com/llvm/llvm-project/pull/105865.
2024-10-03 12:53:28 +01:00
Jacob Lalonde
c11722223b
[LLDB][Minidump] Add Multiplatform test to ensure determinism (#108602)
Adds a test that ensures two minidumps produced from the same target are
the same bytes. Covers the three primary core flavors.
2024-09-26 14:33:12 -07:00
Vladislav Dzhidzhoev
aea0668499
[lldb][test] Use tools from llvm instead of compiler tools (#109961)
In #102185, toolchain detection for API tests has been rewritten in
Python. Tools paths for tests there are determined from compiler path.

Here tools are taken from `--llvm-tools-dir` dotest.py argument, which
by default refers to the LLVM build directory, unless they are
explicitly redefined in environment variables. It helps to minimize
external dependencies and to maximize the reproducibility of the build.
2024-09-25 16:19:02 +02:00
David Spickett
706821ba8f [lldb][test] Skip TestConcurrentVFork on all Linux
And given that it is only for Linux - effectively skip it,
but in a way where we don't forget that it's Linux only.

See https://github.com/llvm/llvm-project/issues/85084.

This test times out on occasion on Arm, AArch64 and X86 Linux,
which I saw just today in a buildkite build. Causing a failure that
is 1. confusing because the PR wasn't for LLDB and 2. annoying
to find in the giant log file (which isn't the test's fault,
but it adds to the overhead).

It's probably important to have this test running somewhere but
right now it's causing too much noise to do so.
2024-09-25 10:08:10 +01:00
David Spickett
497759e872
[lldb][AArch64] Create Neon subregs when XML only includes SVE (#108365)
Fixes #107864

QEMU decided that when SVE is enabled it will only tell us about SVE
registers in the XML, and not include Neon registers. On the grounds
that the Neon V registers can be read from the bottom 128 bits of a SVE
Z register (SVE's vector length is always >= 128 bits).

To support this we create sub-registers just as we do for S and D
registers of the V registers. Except this time we use part of the Z
registers.

This change also updates our fallback for registers with unknown types
that are > 128 bit. This is detailed in
https://github.com/llvm/llvm-project/issues/87471, though that covers
more than this change fixes.

We'll now treat any register of unknown type that is >= 128 bit as a
vector of bytes. So that the user gets to see something
even if the order might be wrong.

And until lldb supports vector and union types for registers, this is
also the only way we can get a value to apply the sub-reg to, to make
the V registers.
2024-09-24 12:40:42 +01:00
Adrian Prantl
1fae1314f1 [lldb] Change the implementation of Status to store an llvm::Error (NFC) (#106774)
(based on a conversation I had with @labath yesterday in
https://github.com/llvm/llvm-project/pull/106442)

Most APIs that currently vend a Status would be better served by
returning llvm::Expected<> instead. If possibles APIs should be
refactored to avoid Status. The only legitimate long-term uses of Status
are objects that need to store an error for a long time (which should be
questioned as a design decision, too).

This patch makes the transition to llvm::Error easier by making the
places that cannot switch to llvm::Error explicit: They are marked with
a call to Status::clone(). Every other API can and should be refactored
to use llvm::Expected. In the end Status should only be used in very few
places.

Whenever an unchecked Error is dropped by Status it logs this to the
verbose API channel.

Implementation notes:

This patch introduces two new kinds of error_category as well as new
llvm::Error types. Here is the mapping of lldb::ErrorType to
llvm::Errors:
```
   (eErrorTypeInvalid)
   eErrorTypeGeneric      llvm::StringError
   eErrorTypePOSIX        llvm::ECError
   eErrorTypeMachKernel   MachKernelError
   eErrorTypeExpression   llvm::ErrorList<ExpressionError>
   eErrorTypeWin32        Win32Error
```

Relanding with built-in cloning support for llvm::ECError, and support
for initializing a Windows error with a NO_ERROR error code, and
modifying TestGDBRemotePlatformFile.py to support different renderings
of ENOSYS.
2024-09-23 14:33:41 -07:00
Med Ismail Bennani
f732157a9d
[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use of it (#109498)
This patch re-lands #105449 and fixes the various test failures.

---------

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-09-20 16:55:47 -07:00
David Spickett
801046e330 Revert "[lldb] Fix SWIG wrapper compilation error"
...and "[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use of it (#105449)"

This reverts commit 76b827bb4d5b4cc4d3229c4c6de2529e8b156810, and commit 1e131ddfa8f1d7b18c85c6e4079458be8b419421
because the first commit caused the test command-stop-hook-output.test to fail.
2024-09-20 09:57:07 +00:00
Med Ismail Bennani
1e131ddfa8
[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use of it (#105449)
This patch introduces new `ScriptedStopHook{,Python}Interface` classes
that make use of the Scripted Interface infrastructure and makes use of
it in `StopHookScripted`.

It also relax the requirement on the number of argument for initializing
scripting extension if the size of the interface parameter pack contains
1 less element than the extension maximum number of positional arguments
for this initializer.
This addresses the cases where the embedded interpreter session
dictionary is passed to the extension initializer which is not used most
of the time.

---------

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-09-19 23:35:34 -07:00
Michael Buch
765e106fb1
[lldb][test] Add a new __compressed_pair layout to libcxx simulator tests (#99012)
This is a follow-up to https://github.com/llvm/llvm-project/pull/98330
for the upcoming `__compressed_pair` refactor in
https://github.com/llvm/llvm-project/issues/93069

This patch just adds the 2 new copies of `_LIBCPP_COMPRESSED_PAIR`
layouts to the simulator tests.
2024-09-16 13:46:19 +01:00
Michael Buch
9e9b1178ca
[lldb] Support new libc++ __compressed_pair layout (#96538)
This patch is in preparation for the `__compressed_pair` refactor in
https://github.com/llvm/llvm-project/pull/76756.

This is mostly reviewable now. With the new layout we no longer need to
unwrap the `__compressed_pair`. Instead, we just need to look for child
members. E.g., to get to the underlying pointer of `std::unique_ptr` we
no longer do,
```
GetFirstValueOfCXXCompressedPair(GetChildMemberWithName("__ptr_"))

```
but instead do
```
GetChildMemberWithName("__ptr_")
```

We need to be slightly careful because previously the
`__compressed_pair` had a member called `__value_`, whereas now
`__value_` might be a member of the class that used to hold the
`__compressed_pair`. So before unwrapping the pair, we added checks for
`isOldCompressedLayout` (not sure yet whether folding this check into
`GetFirstValueOfCXXCompressedPair` is better).
2024-09-16 10:11:49 +01:00
Jacob Lalonde
661382f2c0
[LLDB][Minidump] Minidump erase file on failure (#108259)
In #95312 Minidump file creation was moved from being created at the
end, to the file being emitted in chunks. This causes some undesirable
behavior where the file can still be present after an error has
occurred. To resolve this we will now delete the file upon an error.
2024-09-13 09:17:06 -07:00