Commit Graph

1317 Commits

Author SHA1 Message Date
Jonas Devlieghere
e391301e0e [lldb] Use proc instead of pro to avoid command ambiguity
Use `proc` instead of `pro` to avoid ambiguity between the `process` and
`protocol-server` command.
2025-06-23 10:35:48 -07:00
Ebuka Ezike
8d83d04637 [lldb] add plugin names to process save-core error output. (#143126)
continuation of
[#142684](https://github.com/llvm/llvm-project/pull/142684) to show
plugin names.

From issue [#14258](https://github.com/llvm/llvm-project/issues/142581)
2025-06-23 18:02:58 +01:00
eleviant
80b9fcf8fd Revert "[lldb] Fix qEcho message handling (#145072)" (#145241)
Temporarily revert commit e066f35c69,
because lldb tests randomly hang after it's been pushed.
2025-06-22 18:59:08 +02:00
eleviant
e066f35c69 [lldb] Fix qEcho message handling (#145072)
Patch fixes the sync-on-timeout logic in lldb and switches to qEcho
based ping, instead of qC. This fixes vRun message case, when there is
no process yet and qC returns an error.
2025-06-21 22:48:08 +02:00
Chelsea Cassanova
e0933ab5ae Revert "[lldb][target] Add progress report for wait-attaching to process" (#144810)
This is breaking TestCreateAfterAttach.py on Ubuntu:

```
======================================================================
FAIL: test_create_after_attach_dwo (TestCreateAfterAttach.CreateAfterAttachTestCase.test_create_after_attach_dwo)
   Test thread creation after process attach.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1804, in test_method
    return attrvalue(self)
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 149, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py", line 36, in test_create_after_attach
    self.runCmd("process attach -p " + str(pid))
  File "/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1005, in runCmd
    self.assertTrue(self.res.Succeeded(), msg + output)
AssertionError: False is not true : Command 'process attach -p 1474309' did not return successfully
Error output:
error: attach failed: lost connection
```

on the buildbots for lldb-remote-linux-ubuntu, lldb-arm-ubuntu,
lldb-aarch64-ubuntu, lldb-arm-ubuntu.
2025-06-18 15:39:25 -07:00
Chelsea Cassanova
03bdc0a1f6 [lldb][target] Add progress report for wait-attaching to process (#144768)
This commit adds a progress report when wait-attaching to a process as
well as a test for this.
2025-06-18 13:51:59 -07:00
nerix
b14e03d855 [LLDB] Consolidate C++ string buffer summaries (#144258)
As part of https://github.com/llvm/llvm-project/pull/143177, I moved the
non-libc++ specific formatting of `std::string`s out to `CxxStringTypes`
as MSVC's STL `std::string` can also be thought of a pointer+size pair.
I named this kind of string "string buffer".

This PR picks that change, so the MSVC PR can be smaller.
Unfortunately, libstdc++'s `std::string` does not fit this (it also uses
a different string printer function).

This resolves two FIXMEs in the libc++ tests, where empty u16 and u32
strings didn't have any prefix (u/U).
2025-06-17 17:44:37 +01:00
Michael Buch
41b37f0555 [lldb] CommandObjectMemoryFind: Improve expression evaluation error messages (#144036)
We now bubble up the expression evaluation diagnostics to the user and
also distinguish between "expression failed to parse/run" versus other
ways in which expressions didn't complete (e.g., setup errors, etc.).

Before:
```
(lldb) memory find -e "" 0x16fdfedc0 0x16fdfede0
error: expression evaluation failed. pass a string instead
(lldb) memory find -e "invalid" 0x16fdfedc0 0x16fdfede0
error: expression evaluation failed. pass a string instead
```

After:
```
(lldb) memory find -e "" 0x16fdfedc0 0x16fdfede0
error: Expression evaluation failed:
error: No result returned from expression. Exit status: 1
(lldb) memory find -e "invalid" 0x16fdfedc0 0x16fdfede0
error: Expression evaluation failed:
error: <user expression 0>:1:1: use of undeclared identifier 'invalid'
    1 | invalid
      | ^~~~~~~
```
2025-06-13 12:43:27 +01:00
Michael Buch
1c1df94d09 [lldb][Commands][NFC] Extract memory find expression evaluation into helpers (#143686)
This patch factors out the `-e` option logic into two helper functions.
The `EvaluateExpression` helper might seem redundant but I'll be adding
to it in a follow-up patch to fix an issue when running `memory find -e`
for Swift targets.

Also adds test coverage for the error cases that were previously
untested.

rdar://152113525
2025-06-12 16:48:57 +01:00
Adrian Vogelsgesang
4a46ead8fb [lldb] Show coro_frame in std::coroutine_handle pretty printer (#141516)
This commit adjusts the pretty printer for `std::coroutine_handle` based
on recent personal experiences with debugging C++20 coroutines:

1. It adds the `coro_frame` member. This member exposes the complete
   coroutine frame contents, including the suspension point id and all
   internal variables which the compiler decided to persist into the
   coroutine frame. While this data is highly compiler-specific, inspecting
   it can help identify the internal state of suspended coroutines.
2. It includes the `promise` and `coro_frame` members, even if
   devirtualization failed and we could not infer the promise type / the
   coro_frame type. Having them available as `void*` pointers can still be
   useful to identify, e.g., which two coroutine handles have the same
   frame / promise pointers.
2025-06-11 14:09:54 +02:00
Adrian Vogelsgesang
756e7cfd86 [debuginfo][coro] Fix linkage name for clones of coro functions (#141889)
So far, the `DW_AT_linkage_name` of the coroutine `resume`, `destroy`,
`cleanup` and `noalloc` function clones were incorrectly set to the
original function name instead of the updated function names.

With this commit, we now update the `DW_AT_linkage_name` to the correct
name. This has multiple benefits:

1. it's easier for me (and other toolchain developers) to understand the
   output of `llvm-dwarf-dump` when coroutines are involved.
2. When hitting a breakpoint, both LLDB and GDB now tell you which clone
   of the function you are in. E.g., GDB now prints "Breakpoint 1.2,
   coro_func(int) [clone .resume] (v=43) at ..." instead of "Breakpoint
   1.2, coro_func(int) (v=43) at ...".
3. GDB's `info line coro_func` command now allows you to distinguish the
   multiple different clones of the function.

In Swift, the linkage names of the clones were already updated. The
comment right above the relevant code in `CoroSplit.cpp` already hinted
that the linkage name should probably also be updated in C++. This
comment was added in commit 6ce76ff7eb, and back then the
corresponding `DW_AT_specification` (i.e., `SP->getDeclaration()`) was
not updated, yet, which led to problems for C++. In the meantime, commit
ca1a5b37c7 added code to also update `SP->getDeclaration`, as such
there is no reason anymore to not update the linkage name for C++.

Note that most test cases used inconsistent function names for the LLVM
function vs. the DISubprogram linkage name. clang would never emit such
LLVM IR. This confused me initially, and hence I fixed it while updating
the test case.

Drive-by fix: The change in `CGVTables.cpp` is purely stylistic, NFC.
When looking for other usages of `replaceWithDistinct`, I got initially
confused because `CGVTables.cpp` was calling a static function via an
object instance.
2025-06-11 13:50:32 +02:00
David Spickett
6ec48b449f [lldb] Use 1 based row and column for statusline (#143385)
I can't find a proper source for this but many materials say that ANSI
rows and columns start at 1 not 0.

https://www2.math.upenn.edu/~kazdan/210/computer/ansi.html is as good as
I can get:
```
<row> is a number from 1 through 25 that specifies the row to which the cursor is to be moved.
<col> is a number from 1 through 80 that specifies the column to which the cursor is to be moved.
```

0 does work in Windows terminal and Linux terminals, but we might as
well be correct and it's one less thing to reason about when auditing
this code.

From what I read, some terminals correct 0 back to 1 and some treat 0 as
a missing argument, which also defaults to 1.
2025-06-10 09:59:16 +01:00
Dave Lee
20ca895860 [lldb] Add Python properties to SBBreakpoint and similar (#142215)
Update `SBBreakpoint`, `SBBreakpointLocation`, and `SBBreakpointName` to
add Python properties for many of their getters/setters.
2025-06-03 09:38:22 -07:00
Michael Buch
c48c91a92e [lldb][test] XFAIL TestThreadJump.py on older Clang versions
Failing on the macOS matrix bot for Clang-15 with the following error:
```
07:16:08  FAIL: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/clang_1501_build/bin/clang-arm64) :: test_jump_offset_dwarf (TestThreadJump.ThreadJumpTestCase)
07:16:08  UNSUPPORTED: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/clang_1501_build/bin/clang-arm64) :: test_jump_offset_dwo (TestThreadJump.ThreadJumpTestCase) (test case does not fall in any category of interest for this run)
07:16:08  Restore dir to: /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/lldb-build/tools/lldb/test
07:16:08  ======================================================================
07:16:08  FAIL: test_jump_offset_dsym (TestThreadJump.ThreadJumpTestCase)
07:16:08     Test Thread Jump by negative or positive offset
07:16:08  ----------------------------------------------------------------------
07:16:08  Traceback (most recent call last):
07:16:08    File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1804, in test_method
07:16:08      return attrvalue(self)
07:16:08    File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/functionalities/thread/jump/TestThreadJump.py", line 112, in test_jump_offset
07:16:08      self.expect(f"print {var_2}", substrs=[var_2_value])
07:16:08    File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2512, in expect
07:16:08      self.fail(log_msg)
07:16:08  AssertionError: Ran command:
07:16:08  "print var_2"
07:16:08
07:16:08  Got output:
07:16:08  (int) 20
07:16:08
07:16:08  Expecting sub string: "40" (was not found)
```
2025-06-03 12:17:50 +01:00
Dmitry Vasilyev
68fd6f4eb8 [lldb] Disable TestReverseContinueBreakpoints.py and TestReverseContinueWatchpoints.py for Windows x86_64 (#142193)
See #138084 for details.
2025-06-02 14:01:45 +04:00
Dmitry Vasilyev
fb86264f40 [lldb] Disable TestConsecutiveBreakpoints.py for Windows x86_64 (#142192)
See #138083 for details.
2025-06-02 14:01:13 +04:00
Jason Molenda
3788d45947 [lldb][objc] NSError data formatter test is failing
after PR 138209 stopped applying data formatters
for T** by default, and this test expects that to
work.  We'll need to figure out if we want to drop
this test, or adapt NSError/other objc formatters to
descend an extra level or two of depth.
2025-05-28 22:02:16 -07:00
Zequan Wu
02916a432c [lldb][Formatters] Add --pointer-match-depth option to type summary add command. (#138209)
Currently, the type `T`'s summary formatter will be matched for `T`,
`T*`, `T**` and so on. This is unexpected in many data formatters. Such
unhandled cases could cause the data formatter to crash. An example
would be the lldb's built-in data formatter for `std::optional`:
```
$ cat main.cpp
#include <optional>

int main() {
  std::optional<int> o_null;
  auto po_null = &o_null;
  auto ppo_null = &po_null;
  auto pppo_null = &ppo_null;
  return 0;
}
$ clang++ -g main.cpp && lldb -o "b 8" -o "r" -o "v pppo_null"
[lldb crash]
```

This change adds an options `--pointer-match-depth` to `type summary
add` command to allow users to specify how many layer of pointers can be
dereferenced at most when matching a summary formatter of type `T`, as
Jim suggested
[here](https://github.com/llvm/llvm-project/pull/124048/#issuecomment-2611164133).
By default, this option has value 1 which means summary formatter for
`T` could also be used for `T*` but not `T**` nor beyond. This option is
no-op when `--skip-pointers` is set as well.

I didn't add such option for `type synthetic add`, `type format add`,
`type filter add`, because it useful for those command. Instead, they
all have the pointer match depth of 1. When printing a type `T*`, lldb
never print the children of `T` even if there is a synthetic formatter
registered for `T`.
2025-05-28 16:04:24 -04:00
Ebuka Ezike
dc6aac5e3c [Support] [lldb] Fix thread jump #45326 (#135778)
Fixes #45326 

When you thread jump by calling 
`j +2` or `thread jump --by +2` the offset is not recognised. This
commit fixes that.

---------

Signed-off-by: Ebuka Ezike <yerimyah1@gmail.com>
2025-05-28 10:42:54 +01:00
Jason Molenda
6d6feaf7e3 [lldb][NFC] update API tests which skip/expect-fail arm
The architectures provided to skipIf / expectedFail are regular
expressions (v. _match_decorator_property() in decorators.py
so on Darwin systems "arm64" would match the skips for "arm" (32-bit
Linux).  Update these to "arm$" to prevent this, and also update
three tests (TestBuiltinFormats.py, TestCrossDSOTailCalls.py,
TestCrossObjectTailCalls.py) that were skipped for arm64 via this
behavior, and need to be skipped or they will fail.

This was moviated by the new TestDynamicValue.py test which has
an expected-fail for arm, but the test was passing on arm64 Darwin
resulting in failure for the CIs.
2025-05-27 18:41:16 -07:00
Ebuka Ezike
04f9fac622 [lldb] optionally match the __debug namespace for libstdc++ containers. (#140727)
If libstdc++ is compiled with `_GLIBCXX_DEBUG` flag it puts the containers in the namespace `std::__debug`. this causes the summary and synthetic formatters not to match the types. The formatters is updated to optionally match the `__debug::`.

The formatters now clashed with the libc++ containers namespace regex which uses `std::__1` namespace

The libc++ formatter is loaded first, then the libstdc++ since the priority of the formatters in lldb is the last one added.

Fixes #60841
2025-05-27 20:52:51 +01:00
Michael Buch
9392652226 [lldb][docs][NFC] Remove references to obsolete gnu-libstdc++ category (#141610)
This is still leftover from the days when the libc++ and libstdc++
formatters were both written in python and in separate categories. Since
then we group libstdc++ and libc++ formatters into the same cateogry.

This patch removes references to the obsolete `gnu-libstdc++` category
from the docs (and a test).

See [this
thread](https://github.com/llvm/llvm-project/pull/140761#discussion_r2102386080)
for more context
2025-05-27 18:08:17 +01:00
jimingham
8e3f44d68b Fix a bug where using "thread backtrace unique" would switch you to (#140993)
always using the "frame-format-unique" even when you weren't doing the
unique backtrace mode.
2025-05-22 10:35:35 -07:00
Jason Molenda
cea82573bb [lldb] Skip TestConsecutiveWatchpoints.py if out of tree debugserver
The GreenDragon CI bots are currently passing because the installed
Xcode is a bit old, and doesn't have the watchpoint handling
bug that was fixed April with this test being added.

But on other CI running newer Xcode debugservers, this test will
fail.  Skip this test if we're using an out of tree debugserver.
2025-05-21 17:38:35 -07:00
Igor Kudrin
3f196e0293 [lldb][core] Fix getting summary of a variable pointing to r/o memory (#139196)
Motivation example:

```
> lldb -c altmain2.core
...
(lldb) var F
(const char *) F = 0x0804a000 ""
```

The variable `F` points to a read-only memory page not dumped to the
core file, so `Process::ReadMemory()` cannot read the data. The patch
switches to `Target::ReadMemory()`, which can read data both from the
process memory and the application binary.
2025-05-20 13:50:24 -07:00
Dave Lee
ff127624be [lldb] Reduce max-children-count default to readable size (#139826)
Change the default from 256 to 24. The argument is that 256 is too large to be scanned
by eye, and too large to print in a terminal which can be only 40-50 lines in height.

When all children must be shown, `frame variable` and `expression` both support the `-A`
(`--show-all-children`) flag.

rdar://145327522
2025-05-20 09:34:42 -07:00
Jason Molenda
b8ba9636f0 [lldb] don't run TestUnwindFramelessFaulted.py on Linux
I thought I could call $(CPP) to preprocess the assembly
file, but the aarch64-ubuntu bot runs this as clang -E and
it issues a warning and no output file, apparently,

build/bin/clang -E -o interrupt-and-trap-funcs.s /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/unwind/frameless-faulted/interrupt-and-trap-funcs.s
clang: warning: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/unwind/frameless-faulted/interrupt-and-trap-funcs.s: 'assembler' input unused [-Wunused-command-line-argument]

/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang -g -O0     -c -o interrupt-and-trap-funcs.o interrupt-and-trap-funcs.s
clang: error: no such file or directory: 'interrupt-and-trap-funcs.s'
clang: error: no input files
2025-05-13 18:14:57 -07:00
Jason Molenda
30b428aaa8 [lldb] try re-enabling TestUnwindFramelessFaulted.py
on Linux with a small change to the Makefile to make
preprocessing the assembly code work.
2025-05-13 17:45:03 -07:00
Pavel Labath
91ea494993 [lldb] Move lldb_enable_attach from test_common to a separate header (#139550)
test_common is force-included into every compilation, which causes
problems when we're compiling assembly code, as we were in #138805.

This avoids that as we can include the header only when it's needed.
2025-05-13 17:52:23 +02:00
Ilia Kuklin
3aacd74594 [lldb][TypeSystemClang] Allow arrays to be dereferenced in C/C++. (#135843)
Add a function `GetDereferencedType` to `CompilerType` and allow
`TypeSystemClang` to dereference arrays.
2025-05-12 16:46:58 +05:00
Jason Molenda
48a814c711 Don't run TestUnwindFramelessFaulted.py on Linux
There's something still wrong with how it's building
the test file.
2025-05-11 23:57:53 -07:00
Jason Molenda
b957cc0c7e [lldb] Provide lr value in faulting frame on arm64 (#138805)
Re-landing this patch with small tweaks to address CI bot failures
as it was run on many different configurations.  I think the test
may run on aarch64 Linux systems now.

When a frameless function faults or is interrupted asynchronously, the
UnwindPlan MAY have no register location rule for the return address
register (lr on arm64); the value is simply live in the lr register when
it was interrupted, and the frame below this on the stack -- e.g.
sigtramp on a Unix system -- has the full register context, including
that register.

RegisterContextUnwind::SavedLocationForRegister, when asked to find the
caller's pc value, will first see if there is a pc register location. If
there isn't, on a Return Address Register architecture like
arm/mips/riscv, we rewrite the register request from "pc" to "RA
register", and search for a location.

On frame 0 (the live frame) and an interrupted frame, the UnwindPlan may
have no register location rule for the RA Reg, that is valid. A
frameless function that never calls another may simply keep the return
address in the live register the whole way. Our instruction emulation
unwind plans explicitly add a rule (see Pavel's May 2024 change
https://github.com/llvm/llvm-project/pull/91321 ), but an UnwindPlan
sourced from debug_frame may not.

I've got a case where this exactly happens - clang debug_frame for arm64
where there is no register location for the lr in a frameless function.
There is a fault in the middle of this frameless function and we only
get the lr value from the fault handler below this frame if lr has a
register location of `IsSame`, in line with Pavel's 2024 change.

Similar to how we see a request of the RA Reg from frame 0 after failing
to find an unwind location for the pc register, the same style of
special casing is needed when this is a function that was interrupted.

Without this change, we can find the pc of the frame that was executing
when it was interrupted, but we need $lr to find its caller, and we
don't descend down to the trap handler to get that value, truncating the
stack.

rdar://145614545
2025-05-11 23:39:35 -07:00
Emmanuel Ferdman
2ccfb99d81 [lldb] Fix term settings completion tests (#139447)
# PR Summary
Small PR - Several test functions for `term-width/height` completions
had identical names, causing silent overriding. This gives them distinct
_width/_height suffixes to ensure all tests run.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-05-11 14:47:21 -07:00
Jason Molenda
a230bb0298 Revert "[lldb] Provide lr value in faulting frame on arm64 (#138805)"
This test is failing on the LLDB Incremental bot (arm64), which is
running an older set of tools (Xcode 15.2) and OS (macOS 14.1) and
the CFI directives must not be emitted correctly by either the tools
or the OS.  I will need to reproduce how this is compiling on that
older setup and see what the issue is.  Reverting for now so the
bots are not blocked.

This reverts commit e897cb139e.
2025-05-09 20:41:15 -07:00
Jason Molenda
d2f6ac2c10 Revert "Fix skipIf which was doing || and I need &&"
This reverts commit 05a2b33f7b.
2025-05-09 20:41:08 -07:00
Jason Molenda
f6ca690c43 Revert "Stop running test on Linux for now"
This reverts commit 76f0f4cdf4.
2025-05-09 20:41:02 -07:00
Jason Molenda
76f0f4cdf4 Stop running test on Linux for now
Failed at compile time lldb-aarch64-ubuntu bot.
It did clang -E -o interrupt-and-trap-funcs.s interrupt-and-trap-funcs.c
and that added a bunch of standard C header typedefs to
the output .s file which then turn into compile errors
when it tries to compile the .s file as assembly.  Never saw
that behavior in my testing on an ubuntu 24.04 system.

It would have been nice to have the test run on Linux as well
as Darwin, but it's not essential.
2025-05-09 20:20:51 -07:00
Jason Molenda
05a2b33f7b Fix skipIf which was doing || and I need &&
only run this test on linux or darwin
when targetting arm64/aarch64.
2025-05-09 20:12:56 -07:00
Jason Molenda
e897cb139e [lldb] Provide lr value in faulting frame on arm64 (#138805)
When a frameless function faults or is interrupted asynchronously, the
UnwindPlan MAY have no register location rule for the return address
register (lr on arm64); the value is simply live in the lr register when
it was interrupted, and the frame below this on the stack -- e.g.
sigtramp on a Unix system -- has the full register context, including
that register.

RegisterContextUnwind::SavedLocationForRegister, when asked to find the
caller's pc value, will first see if there is a pc register location. If
there isn't, on a Return Address Register architecture like
arm/mips/riscv, we rewrite the register request from "pc" to "RA
register", and search for a location.

On frame 0 (the live frame) and an interrupted frame, the UnwindPlan may
have no register location rule for the RA Reg, that is valid. A
frameless function that never calls another may simply keep the return
address in the live register the whole way. Our instruction emulation
unwind plans explicitly add a rule (see Pavel's May 2024 change
https://github.com/llvm/llvm-project/pull/91321 ), but an UnwindPlan
sourced from debug_frame may not.

I've got a case where this exactly happens - clang debug_frame for arm64
where there is no register location for the lr in a frameless function.
There is a fault in the middle of this frameless function and we only
get the lr value from the fault handler below this frame if lr has a
register location of `IsSame`, in line with Pavel's 2024 change.

Similar to how we see a request of the RA Reg from frame 0 after failing
to find an unwind location for the pc register, the same style of
special casing is needed when this is a function that was interrupted.

Without this change, we can find the pc of the frame that was executing
when it was interrupted, but we need $lr to find its caller, and we
don't descend down to the trap handler to get that value, truncating the
stack.

rdar://145614545
2025-05-09 20:07:12 -07:00
Felipe de Azevedo Piovezan
28156539a9 [lldb] Disable test using GetControlFlowKind on arm 2025-05-08 13:14:40 -07:00
Jonas Devlieghere
45cd708184 [lldb] Change the statusline format to print "no target" (#139021)
Change the default statusline format to print "no target" when lldb is
launched without a target. Currently, the statusline is empty, which
looks rather odd.
2025-05-08 09:09:46 -07:00
Felipe de Azevedo Piovezan
cb0b9614f8 [lldb] Disable test using GetControlFlowKind on arm
This is only implemented for x86.
Originally introduced in: https://github.com/llvm/llvm-project/pull/137904
2025-05-08 08:11:17 -07:00
Ely Ronnen
4132141681 [lldb] Expose QueueThreadPlanForStepSingleInstruction function to SBThreadPlan (#137904)
Expose `QueueThreadPlanForStepSingleInstruction` function to
SBThreadPlan
2025-05-08 14:01:42 +02:00
Jacob Lalonde
c50cba6275 [LLDB][SBSaveCore] Sbsavecore subregions bug (#138206)
Custom regions in Process::GetUserSpecifiedCoreFileSaveRanges originally
used `FindEntryThatContains`. This made sense on my first attempt, but
what we really want are *intersecting* regions. This is so the user can
specify arbitrary memory, and if it's available we output it to the core
(Minidump or MachO).
2025-05-05 11:04:55 -07:00
Felipe de Azevedo Piovezan
f784fa7275 [lldb] Disable TestExitDuringExpression on asan
This test is trying to exercise code running constructors with
interrupts. While we should fix this, this is creating noise on the
bots.
2025-04-29 12:38:51 -07:00
Michael Buch
9147569c7f [lldb][test] Rename reverse-execution/TestReverseContinueNotSupported.py
Otherwise `lldb-dotest` fails with:
```
Traceback (most recent call last):
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/test/API/dotest.py", line 8, in <module>
    lldbsuite.test.run_suite()
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 1063, in run_suite
    visit("Test", dirpath, filenames)
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 701, in visit
    raise Exception("Found multiple tests with the name %s" % name)
Exception: Found multiple tests with the name TestReverseContinueNotSupported.py
```
2025-04-25 14:26:50 +01:00
Jonas Devlieghere
3ccfbc8a00 [lldb] Make sure changing the separator takes immediate effect (#136779)
The setter is only used when changing the setting programmatically. When
using the settings command, we need to monitor SetPropertyValue.
2025-04-22 22:38:28 -07:00
Adrian Prantl
6f1adbdb2b [lldb] Make the statusline separator configurable (#136611)
And use this functionality to replace the ASCII "|" with the same
full-geight line-drawing character used in diagnostics rendering on a
color terminal.
2025-04-22 12:59:46 -07:00
Shubham Sandeep Rastogi
1042d99887 disable test on older compilers (#136186) 2025-04-17 12:33:30 -07:00
Jonas Devlieghere
8311620933 [lldb] Fix lock inversion between statusline mutex and output mutex (#135956)
Fix a deadlock between the statusline mutex (in Debugger) and the output
file mutex (in LockedStreamFile). The deadlock occurs when the main
thread is calling the statusline callback while holding the output mutex
in Editline, while the default event thread is trying to update the
statusline.

Extend the uncritical section so we can redraw the statusline there.
The loop in Editline::GetCharacter should be unnecessary. It would only
loop if we had a successful read with length zero, which shouldn't be
possible or when we can't convert a partial UTF-8 character, in which
case we bail out.

rdar://149251156
2025-04-17 17:57:00 +02:00