summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Register
AgeCommit message (Collapse)Author
2025-10-30[NFCI][lldb][test] Add missing <functional> includes (#165772)Raul Tambre
`std::ref()` is provided in `<functional>` and with recent libc++ changes it no longer seems to be included transitively. Fix by including explicitly.
2025-05-30[LLDB][Platform Linux] Flip uid and pid in get signal description (#142200)Jacob Lalonde
Despite a great review from @labath, I accidentally landed the signal with the UID and PID properties flipped. I was actually trying to write tests for this feature when I discovered it. This fixes that bug, and add a shell test that runs only on Nix systems.
2025-02-21[lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo`wanglei
Fixes: https://github.com/llvm/llvm-project/issues/123903 Reviewed By: DavidSpickett, SixWeining Pull Request: https://github.com/llvm/llvm-project/pull/124059
2025-02-20[lldb][RISC-V] Extended if conditions to support alias names for registers ↵kper
(#124475) Extending the conditionals in `AugmentRegisterInfo` to support alternative names for lldb. Fixes #124023 There is an exception with register `X8` which is not covered here but more details can be found in the issue https://github.com/llvm/llvm-project/issues/127900.
2025-01-23[lldb] Enable "frame diagnose" on linux (#123217)Pavel Labath
.. by changing the signal stop reason format :facepalm: The reason this did not work is because the code in `StopInfo::GetCrashingDereference` was looking for the string "address=" to extract the address of the crash. Macos stop reason strings have the form ``` EXC_BAD_ACCESS (code=1, address=0xdead) ``` while on linux they look like: ``` signal SIGSEGV: address not mapped to object (fault address: 0xdead) ``` Extracting the address from a string sounds like a bad idea, but I suppose there's some value in using a consistent format across platforms, so this patch changes the signal format to use the equals sign as well. All of the diagnose tests pass except one, which appears to fail due to something similar #115453 (disassembler reports unrelocated call targets). I've left the tests disabled on windows, as the stop reason reporting code works very differently there, and I suspect it won't work out of the box. If I'm wrong -- the XFAIL will let us know.
2024-11-21[LLDB][ProcessELFCore] Add Description to ProcessELFCore/ELFThread stop ↵Jacob Lalonde
reasons (#110065) This fixes a functionality gap with GDB, where GDB will properly decode the stop reason and give the address for SIGSEGV. I also added descriptions to all stop reasons, following the same code path that the Native Linux Thread uses.
2024-10-31[lldb] Remove lldb-repro utilityJonas Devlieghere
Remove lldb-repro which was used to run the test suite against a reproducer. The corresponding functionality has been removed from LLDB so there's no need for the tool anymore.
2024-07-03[lldb][AArch64] Add register field enum information (#96887)David Spickett
This enables XML output for enums and adds enums for 2 fields on AArch64 Linux: * mte_ctrl.tcf, which controls how tag faults are delivered. * fpcr.rmode, which sets the rounding mode for floating point operations. The other one we could do is cpsr.btype, but it is not clear what would be useful here so I'm not including it in this change.
2024-07-01[lldb][FreeBSD][AArch64] Enable register field detection (#85058)David Spickett
This extends the existing register fields support from AArch64 Linux to AArch64 FreeBSD. So you will now see output like this: ``` (lldb) register read cpsr cpsr = 0x60000200 = (N = 0, Z = 1, C = 1, V = 0, DIT = 0, SS = 0, IL = 0, SSBS = 0, D = 1, A = 0, I = 0, F = 0, nRW = 0, EL = 0, SP = 0) ``` Linux and FreeBSD both have HWCAP/HWCAP2 so the detection mechanism is the same and I've renamed the detector class to reflect that. I have confirmed that FreeBSD's treatment of CPSR (spsr as the kernel calls it) is similair enough that we can use the same field information. (see `sys/arm64/include/armreg.h` and `PSR_SETTABLE_64`) For testing I've enabled the same live process test as Linux and added a shell test using an existing FreeBSD core file. Note that the latter does not need XML support because when reading a core file we are not sending the information via target.xml, it's just internal to LLDB.
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
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-03-17[lldb][test] Replace use of p with expression in Shell tests (NFC)Dave Lee
In Shell tests, replace use of the `p` alias with the `expression` command. To avoid conflating tests of the alias with tests of the expression command, this patch canonicalizes to the use `expression`. See also D141539 which made the same change to API tests. Differential Revision: https://reviews.llvm.org/D146230
2023-01-19[lldb] Re-enable xmm/ymm/zmm tests with the system debugserverJonas Devlieghere
Re-enable the xmm/ymm/zmm tests now that the system debugserver used by our CI is capable or writing xmm/ymm/zmm registers.
2022-04-06Correct debugserver to write xmm/ymm/zmm reg valuesJason Molenda
debugserver does not call thread_set_state when changing xmm/ymm/zmm register values, so the register contents are never updated. Fix that. Mark the shell tests which xfail'ed these tests on darwin systems to xfail them when the system debugserver, they will pass when using the in-tree debugserver. When this makes it into the installed system debugservers, we'll remove the xfails. Differential Revision: https://reviews.llvm.org/D123269 rdar://91258333 rdar://31294382
2022-02-02[LLDB] add sub regigter enums on x64 WindowsZequan Wu
Differential Revision: https://reviews.llvm.org/D118750
2021-09-09[lldb] [test] Add tests for coredumps with multiple threadsMichał Górny
Differential Revision: https://reviews.llvm.org/D101157
2021-06-20[lldb] [Process/elf-core] Fix reading NetBSD/i386 core dumpsMichał Górny
Add support for extracting basic data from NetBSD/i386 core dumps. FPU registers are not supported at the moment. Differential Revision: https://reviews.llvm.org/D101091
2021-05-12[lldb] [Process/elf-core] Fix reading FPRs from FreeBSD/i386 coresMichał Górny
The FreeBSD coredumps from i386 systems contain only FSAVE-style NT_FPREGSET. Since we do not really support reading that kind of data anymore, just use NT_X86_XSTATE to get FXSAVE-style data when available. Differential Revision: https://reviews.llvm.org/D101086
2021-04-21[lldb] [test/Register] Initial tests for regsets in core dumpsMichał Górny
Add initial tests for reading register sets from core dumps. This includes a C++ program to write registers and dump core, resulting core dumps for Linux, FreeBSD and NetBSD, and the tests to verify them. The tests are split into generic part, verifying user-specified register values, and coredump-specific tests that verify memory addresses that differ for every dump. At this moment, all platforms support GPRs and FPRs up to XMM for amd64 target. The i386 target does not work on NetBSD at all, and is missing FPRs entirely on FreeBSD. Differential Revision: https://reviews.llvm.org/D91963
2021-02-11[lldb] Disable x86-multithread-write.test with reproducersJonas Devlieghere
This test is failing on GreenDragon. Disabling it until I have bandwidth to investigate why the register values are different during replay.
2021-01-07[lldb] [debugserver] Add stN aliases for stmmN for compatibilityMichał Górny
Add stN aliases for the FPU (stmmN) registers on MacOSX. This should improve compatibility between MacOSX and other platforms, and partially fix x86*-fp-write tests without having to duplicate them. Note that the tests are currently still broken due to ftag incompatibility. Differential Revision: https://reviews.llvm.org/D91847
2020-11-21[lldb] Reland "Use translated full ftag values"Michał Górny
Translate between abridged and full ftag values in order to expose the latter in the gdb-remote protocol while the former are used by FXSAVE/XSAVE... This matches the gdb behavior. The Shell/Register tests now rely on the new behavior, and therefore are run on non-Darwin systems only. The Python (API) test relies on the legacy behavior, and is run on Darwin only. Differential Revision: https://reviews.llvm.org/D91504
2020-11-20[lldb] [test/Register] XFAIL x86-fp-write on DarwinMichał Górny
2020-11-20Revert "[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.test"Michał Górny
The problem is not specific to arch but to the whole Darwin platform. Reverts: 0fd04337a17138174adf9e6d408cf9c885dea086
2020-11-19[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.testshafik
D91497 changed lldb/test/Shell/Register/x86-fp-write.test and added target-x86_64 to the REQUIRES clause. It looks this test does not pass on this platform so removing it since it one of tests failing on the green dragon build bot.
2020-11-19Revert "[lldb] Use translated full ftag values"Mikhail Goncharov
This reverts commit c43abf043692babf9ad4f8bded2fdf6ab9c354b0. Test commands/register/register/register_command/TestRegisters.py fails. Buildbot http://lab.llvm.org:8011/#/changes/4149
2020-11-19[lldb] Use translated full ftag valuesMichał Górny
Translate between abridged and full ftag values in order to expose the latter in the gdb-remote protocol while the former are used by FXSAVE/XSAVE... This matches the gdb behavior. Differential Revision: https://reviews.llvm.org/D91504
2020-11-19[lldb] Add explicit 64-bit fip/fdp registers on x86_64Michał Górny
The FXSAVE/XSAVE data can have two different layouts on x86_64. When called as FXSAVE/XSAVE..., the Instruction Pointer and Address Pointer registers are reported using a 16-bit segment identifier and a 32-bit offset. When called as FXSAVE64/XSAVE64..., they are reported using a complete 64-bit offsets instead. LLDB has historically followed GDB and unconditionally used to assume the 32-bit layout, with the slight modification of possibly using a 32-bit segment register (i.e. extending the register into the reserved 16 upper bits). When the underlying operating system used FXSAVE64/XSAVE64..., the pointer was split into two halves, with the upper half repored as the segment registers. While reconstructing the full address was possible on the user end (and e.g. the FPU register tests did that), it certainly was not the most convenient option. Introduce a two additional 'fip' and 'fdp' registers that overlap with 'fiseg'/'fioff' and 'foseg'/'foff' respectively, and report the complete 64-bit address. Differential Revision: https://reviews.llvm.org/D91497
2020-11-18[lldb] [test] Pass -mmmx to x86-gp-write test explicitlyMichał Górny
Pass -mmmx explicitly to fix build failure with FreeBSD's clang on i386. Differential Revision: https://reviews.llvm.org/D91578
2020-11-12[lldb] [test] Add a minimal test for x86 dbreg readingMichał Górny
Add a test verifying that after the 'watchpoint' command, new values of x86 debug registers can be read back correctly. The primary purpose of this test is to catch broken DRn reading and help debugging it. Differential Revision: https://reviews.llvm.org/D91264
2020-10-26[lldb] [test/Register] Use initial state for write testsMichał Górny
Reset registers to their 'initial' state instead of a semi-random pattern in write tests. While the latter might have been helpful while debugging failures (i.e. to distinguish unmodified registers from mistakenly written zeroes), the former makes it possible to test whether xstate_bv field is written correctly when using XSAVE. With this change, the four relevant tests start failing on NetBSD without D90105. Differential Revision: https://reviews.llvm.org/D90114
2020-10-14[lldb] [test/Register] Add read/write tests for multithreaded processMichał Górny
Add a test to verify that 'register read' and 'register write' commands work correctly in a multithreaded program, in particular that they read or write registers for the correct thread. The tests use locking to ensure that events are serialized and the test can execute reliably. Differential Revision: https://reviews.llvm.org/D89248
2020-10-04[lldb] [test/Register] Attempt to fix x86-fp-read.test on DarwinMichał Górny
Darwin seems to use stmmN instead of stN. Use a regex to accept both. Also try to actually clear st(7). Differential revision: https://reviews.llvm.org/D88795
2020-10-03[lldb] [test/Register] Mark new FP reg tests XFAIL on DarwinJonas Devlieghere
This is failing on GreenDragon: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24066/
2020-10-03[lldb] [test/Register] Mark new FP reg tests XFAIL on WindowsMichał Górny
2020-10-03[lldb] [test/Register] Add read/write tests for x87 regsMichał Górny
Add a partial read/write tests for x87 FPU registers. This includes reading and writing ST registers, control registers and floating-point exception data registers (fop, fip, fdp). The tests assume the current (roughly incorrect) behavior of reporting the 'abridged' 8-bit ftag state as 16-bit ftag. They also assume Linux plugin behavior of reporting fip/fdp split into halves as (fiseg, fioff) and (foseg, fooff). Differential Revision: https://reviews.llvm.org/D88583
2020-06-30Skip arm-(fp|gp)-read.test on Darwin.Davide Italiano
Our assembler doesn't seem to grok floating point literals. <rdar://problem/64951608>
2020-04-10[lldb/Reproducers] Fix typo introduced when disabling register failing testsMed Ismail Bennani
2020-04-09[lldb/test] Fix typo to disable reproducer's test phaseMed Ismail Bennani
2020-04-09[lldb] Disable failing register tests for reproducersMed Ismail Bennani
2020-01-28[lldb] [test] Restrict x86-64-write register test to x86-64Michał Górny
2019-10-31[lldb/lit] Introduce %clang_host substitutionsPavel Labath
Summary: This patch addresses an ambiguity in how our existing tests invoke the compiler. Roughly two thirds of our current "shell" tests invoke the compiler to build the executables for the host. However, there is also a significant number of tests which don't build a host binary (because they don't need to run it) and instead they hardcode a certain target. We also have code which adds a bunch of default arguments to the %clang substitutions. However, most of these arguments only really make sense for the host compilation. So far, this has worked mostly ok, because the arguments we were adding were not conflicting with the target-hardcoding tests (though they did provoke an occasional "argument unused" warning). However, this started to break down when we wanted to use target-hardcoding clang-cl tests (D69031) because clang-cl has a substantially different command line, and it was getting very confused by some of the arguments we were adding on non-windows hosts. This patch avoid this problem by creating separate %clang(xx,_cl)_host substutitions, which are specifically meant to be used for compiling host binaries. All funny host-specific options are moved there. To ensure that the regular %clang substitutions are not used for compiling host binaries (skipping the extra arguments) I employ a little hac^H^H^Htrick -- I add an invalid --target argument to the %clang substitution, which means that one has to use an explicit --target in order for the compilation to succeed. Reviewers: JDevlieghere, aprantl, mstorsjo, espindola Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69619
2019-10-21[LLDB] [Windows] Initial support for ARM register contextsMartin Storsjo
Differential Revision: https://reviews.llvm.org/D69226 llvm-svn: 375392
2019-10-15[LLDB] [Windows] Initial support for ARM64 register contextsMartin Storsjo
Differential Revision: https://reviews.llvm.org/D67954 llvm-svn: 374866
2019-10-09Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere
The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201
2019-10-09Revert [test] Split LLDB tests into API, Shell & UnitAdrian Prantl
as it appears to have broken check-lldb. This reverts r374184 (git commit 22314179f0660c172514b397060fd8f34b586e82) llvm-svn: 374187
2019-10-09[test] Split LLDB tests into API, Shell & UnitJonas Devlieghere
LLDB has three major testing strategies: unit tests, tests that exercise the SB API though dotest.py and what we currently call lit tests. The later is rather confusing as we're now using lit as the driver for all three types of tests. As most of this grew organically, the directory structure in the LLDB repository doesn't really make this clear. The 'lit' tests are part of the root and among these tests there's a Unit and Suite folder for the unit and dotest-tests. This layout makes it impossible to run just the lit tests. This patch changes the directory layout to match the 3 testing strategies, each with their own directory and their own configuration file. This means there are now 3 directories under lit with 3 corresponding targets: - API (check-lldb-api): Test exercising the SB API. - Shell (check-lldb-shell): Test exercising command line utilities. - Unit (check-lldb-unit): Unit tests. Finally, there's still the `check-lldb` target that runs all three test suites. Finally, this also renames the lit folder to `test` to match the LLVM repository layout. Differential revision: https://reviews.llvm.org/D68606 llvm-svn: 374184