Commit Graph

603 Commits

Author SHA1 Message Date
Kazu Hirata
c045caae86 [lldb] Proofread python-reference.rst (#149643) 2025-07-20 11:23:57 -07:00
David Spickett
9f364fe9c4 [lldb][docs] Add section on testing with QEMU user (#149057)
This is not recommended to basically anyone but on occasion it's useful
and could be used for testing with other simulator programs for example
bare metal simulators.

It is not something we do officially support or make any quality
guarantees for.

Adding this is also an excuse to document the limitations and make the
time spent setting up system mode look more worthwhile and might be good
to cite in future discussions about testing in simulation.
2025-07-16 17:47:21 +01:00
David Spickett
97922a7d40 [lldb][docs] Add CAMKE_BUILD_TYPE to standlone build instructions
The first stage requires it, the second appears to default to
debug mode, which works but it's better we advise release mode
to match.
2025-07-16 16:44:40 +00:00
Jonas Devlieghere
e8dc96d9de [lldb] Document MCP tools & resources (#148708)
Add documentation for the tools and resources exposed by LLDB's MCP
server.
2025-07-16 09:31:43 -07:00
Jonas Devlieghere
17cb0a73a0 [lldb][docs] Fix another broken markdown link 2025-07-03 14:19:09 -07:00
Jonas Devlieghere
eb904e857a [lldb] Fix link syntax in docs/use/mcp.md 2025-06-30 13:50:32 -07:00
Jonas Devlieghere
16dc6f64de [lldb] Document MCP support in LLDB (#145935)
Document how to use MCP support in LLDB. I expect this to change
significantly as the feature matures. For now it covers configuring the
server and two example clients.
2025-06-30 09:01:15 -07:00
Kazu Hirata
9f5061d4f0 [lldb] Fix a typo in documentation (#146115) 2025-06-27 14:26:32 -07:00
David Spickett
d59e0ba80b [lldb][docs] Document qWatchpointSupportInfo (#145709) 2025-06-26 13:41:33 +01:00
Pavel Labath
46e1e9f104 Reapply "[lldb/cmake] Plugin layering enforcement mechanism (#144543)" (#145305)
The only difference from the original PR are the added BRIEF and
FULL_DOCS arguments to define_property, which are required for
cmake<3.23.
2025-06-24 11:10:35 +02:00
Pavel Labath
18f667d804 Revert "[lldb/cmake] Plugin layering enforcement mechanism (#144543)"
Causes failures on several bots.

This reverts commits 714b2fdf3a and
e7c1da7c8e.
2025-06-23 12:07:10 +02:00
Pavel Labath
e7c1da7c8e [lldb/cmake] Plugin layering enforcement mechanism (#144543)
Some inter-plugin dependencies are okay, others are not. Yet others not,
but we're sort of stuck with them. The idea is to be able to prevent
backsliding while making sure that acceptable dependencies are..
accepted. For context, see
https://github.com/llvm/llvm-project/pull/139170 and the attached
changes to the documentation.
2025-06-23 11:31:26 +02:00
Michael Buch
5a918923f3 [lldb][Format] Add [inlined] marker to names of inlined frames (#142952)
This was removed in https://github.com/llvm/llvm-project/pull/135343 in
favour of making it a format variable, which we do here. This follows
the precedent of the `[opt]` and `[artificial]` markers.

Before:
```
 thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
 * frame #0: 0x000000010000037c a.out`inlined1() at inline.cpp:4:3
   frame #1: 0x000000010000037c a.out`regular() at inline.cpp:6:17
   frame #2: 0x00000001000003b8 a.out`inlined2() at inline.cpp:7:43
   frame #3: 0x00000001000003b4 a.out`main at inline.cpp:10:3
   frame #4: 0x0000000186345be4 dyld`start + 7040
```

After (note the `[inlined]` markers):
```
thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
* frame #0: 0x000000010000037c a.out`inlined1() at inline.cpp:4:3 [inlined]
  frame #1: 0x000000010000037c a.out`regular() at inline.cpp:6:17
  frame #2: 0x00000001000003b8 a.out`inlined2() at inline.cpp:7:43 [inlined]
  frame #3: 0x00000001000003b4 a.out`main at inline.cpp:10:3
  frame #4: 0x0000000186345be4 dyld`start + 7040
```

rdar://152642178
2025-06-05 17:41:37 +01: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
Charles Zablit
b8997c07d9 [Demangling] Refactor Demangler range tracking (#140762)
This PR is a subset of the commits made in
https://github.com/swiftlang/llvm-project/pull/10710.

The most notable change is the addition of `PrefixRange` and
`SuffixRange` which are a catch-all to track anything after or before a
function's demangled name. In the case of Swift, this allows to add
support for name highlighting without having to track the range of the
scope and specifiers of a function (this will come in another PR).
2025-05-28 13:53:02 +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
Ilia Kuklin
fe51d8ae57 [LLDB] Add array subscription and integer parsing to DIL (#141102)
Reapply #138551 with an xfailed test on Windows
2025-05-25 21:09:33 +05:00
Kazu Hirata
6235479db3 [lldb] Fix a typo in documentation (#141384) 2025-05-25 08:20:04 -07:00
cmtice
53d7b1d9e0 [LLDB] Add field member operators to DIL (#138093)
Add the arrow and period operators, allowing DIL to find and access
member fields.
2025-05-23 07:30:10 -07:00
Ilia Kuklin
5df819ffb3 Revert "[LLDB] Add array subscription and integer parsing to DIL" (#141059)
Reverts llvm/llvm-project#138551
2025-05-22 17:33:01 +05:00
Ilia Kuklin
491619a250 [LLDB] Add array subscription and integer parsing to DIL (#138551) 2025-05-22 16:15:11 +05:00
Ebuka Ezike
1b6b036c02 [lldb][docs] add command to save core file in gdb to lldb command map. (#140771) 2025-05-20 20:57:51 +01:00
LauraElanorJones
9178a17206 Update python.rst (#140333)
Fix code block formatting in section "The Decision Point Breakpoint
Commands"
2025-05-16 19:17:03 -07:00
Kazu Hirata
bdf8c9984a [lldb] Fix typos in documentation (#139839) 2025-05-13 23:34:28 -07:00
David Spickett
62385b8487 [lldb][docs] Correct spelling in debugging doc 2025-05-07 10:07:02 +00:00
Pavel Labath
6a99d81720 [lldb/docs] Fix/improve the gdb command map for dynamic types (#138538)
The setting and option value names were wrong. I'm assuming this changed
over time, but I haven't tried to figure out when.
2025-05-06 15:06:24 +02:00
Ilia Kuklin
d637038429 [LLDB] Add unary operators Dereference and AddressOf to DIL (#134428) 2025-04-29 21:29:52 +05:00
Michael Buch
64b5bc876a [lldb][Format] Add function.suffix frame-format variable (#137763)
This patch adds another frame-format variable (currently only
implemented in the CPlusPlus language plugin) that represents the
"suffix" of a function. The name is derived from the `DotSuffix` node of
LLVM's Itanium demangler.

For a function name such as `int foo() (.cold)`, the suffix would be
`(.cold)`.
2025-04-29 10:02:44 +01:00
Michael Buch
fcb1a481ce [lldb][docs] Document new frame-format variables (#137522)
Documents https://github.com/llvm/llvm-project/pull/131836
2025-04-28 08:28:54 +01:00
cor3ntin
320ec7fa7f [Documentation] Always use SVG for dot-generated doxygen images. (#136843)
Despite our attempt (build-docs.sh)
to build the documentation with SVG,
it still uses PNG https://llvm.org/doxygen/classllvm_1_1StringRef.html,

and that renders terribly on any high dpi display.

SVG leads to smasller installation and works fine
on all browser (that has been true for _a while_
https://caniuse.com/svg), so this patch just unconditionally build all
dot graphs as SVG in all subprojects and remove the option.
2025-04-25 14:13:17 +02:00
David Spickett
382263376f [lldb][docs] Repeat required Python version number
We do say it in the table below but if you didn't
want any optional stuff you'd miss it.
2025-04-22 08:53:01 +00:00
cmtice
46e2c07fa2 [LLDB] Add DIL code for handling plain variable names. (#120971)
Add the Data Inspection Language (DIL) implementation pieces for
handling plain local and global variable names.

See https://discourse.llvm.org/t/rfc-data-inspection-language/69893 for
information about DIL.

This change includes the basic AST, Lexer, Parser and Evaluator pieces,
as well as some tests.
2025-04-03 21:39:30 -07:00
Jonas Devlieghere
51c2750599 [lldb] Update examples in docs/use/python-reference.rst to work with Python 3 (#134204)
The examples on this page were using the Python 2-style print. I ran the
updated code examples under Python 3 to confirm they are still
up-to-date.
2025-04-03 07:40:00 -07:00
Kon
d4b586ad95 [LLDB][NFC] Fix typo in docs (#131388) 2025-03-20 09:19:33 +01:00
Julius Alexandre
5757da1480 [lldb][docs] Added LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS for macOS configuration (#130381)
Referenced here:
https://github.com/llvm/llvm-project/issues/130171#issuecomment-2707058235

I think this will allow for issues relating towards missing modules for
test suites to be more manageable.

cc @adrian-prantl

---------

Co-authored-by: medievalghoul <61852278+medievalghoul@users.noreply.github.com>
2025-03-10 15:23:49 -07:00
Greg Clayton
8ac359ba0d Add complete ObjectFileJSON support for sections. (#129916)
Sections now support specifying:
- user IDs
- file offset/size
- alignment
- flags
- bool values for fake, encrypted and thread specific sections
2025-03-07 15:34:27 -08:00
Alex Bradbury
db2953d801 [doc] Add Discord invite link alongside channel links (#126352)
By far the most important part of this patch is updating
GettingInvolved.rst to include the invite link, but I've grepped for any
other discord.com links.

I'm no Discord expert, but from my experience (confirmed via @preames
kindly testing as well) the direct channel links provide a confusing
experience if you haven't already found and used an invite link to the
LLVM Discord server. If you're logged into Discord but not a member of
LLVM's sever, the web app opens and then...nothing. No channel opens, no
prompt to join the server or even a hint that you need to find an invite
link (and if you're not used to Discord, you likely don't even know
that's necessary).

This patch addresses the issue by providing the invite link where
Discord is mentioned.
2025-02-13 15:00:21 +00:00
Pavel Labath
ad38c4c625 [lldb] Document lldb x packet deprecation. (#125682) 2025-02-05 09:26:26 +01:00
David Spickett
5d738b2be0 [lldb][Docs] Expand remote testing instructions (#122694)
There's a lot of fiddly bits to get right here, so I've added a more
complete example and explained why you might choose one method over
another.

I thought about adding this to the qemu testing page, as that's what we
(Linaro) use this for mostly, but it applies to any remote system
whether hardware or simulator.
2025-02-03 09:10:20 +00:00
Dave Lee
1b0becf739 [lldb] Add some formatting to variable.rst (NFC) 2025-01-31 09:29:22 -08:00
David Spickett
9ea64dd878 [lldb] Make Python >= 3.8 required for LLDB 21 (#124735)
As decided on
https://discourse.llvm.org/t/rfc-lets-document-and-enforce-a-minimum-python-version-for-lldb/82731.

LLDB 20 recommended `>= 3.8` but did not remove support for anything
earlier. Now we are in what will become LLDB 21, so I'm removing that
support and making
`>= 3.8` required.

See https://docs.python.org/3/c-api/apiabiversion.html#c.PY_VERSION_HEX
for the format of PY_VERSION_HEX.
2025-01-29 09:56:41 +00:00
David Spickett
6d0dd3d5c4 [lldb][Docs] Add Guarded Control Stack to AArch64 Linux page (#117860)
The meat of this is how we execute expressions and deal with the
aftermath. For most users this will never be a concern, so it functions
more as a design doc than anything else.
2025-01-28 11:38:58 +00:00
Jonas Devlieghere
06c54bc1a2 [lldb] Implement ${target.file} format variable (#123431)
Implements a format variable to print the basename and full path to the
current target.
2025-01-20 15:38:04 -08:00
David Spickett
b0c0a148db [lldb][Docs] Add equivalents of GDB's "skip" to command map (#120740)
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Skipping-Over-Functions-and-Files.html

We can't emulate all the features of that command but we can skip a
function by name with some extra steps.

As far as I know this only matches function name unlike GDB that can
filter on file and line and so on:
```
target.process.thread.step-avoid-regexp -- A regular expression defining functions step-in won't stop in.
```
It's likely it's got some corner cases that don't work, maybe inlining,
but it doesn't seem worth going into it here.

I don't think we can chain lldb interpreter commands, so I have shown
the steps separately.

I have also mentioned `thread step-in` and its alias `sif`. Which were
new to me too.
2025-01-06 09:17:25 +00:00
Adrian Prantl
ee1adc5aab [lldb] Add a return opcode to the formatter bytecode (#121602)
In LLVM we love our early exists and this opcode allows for simpler code
generation.
2025-01-03 15:26:40 -08:00
Adrian Prantl
9ee454a57c [lldb] Fix RST table formatting 2024-12-16 10:42:37 -08:00
Adrian Prantl
fffe8c6684 [lldb] Add a compiler/interpreter of LLDB data formatter bytecode to examples
This PR adds a proof-of-concept for a bytecode designed to ship and
run LLDB data formatters. More motivation and context can be found in
the formatter-bytecode.rst file and on discourse.

https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696

Relanding with a fix for a case-sensitive path.
2024-12-06 16:27:16 -08:00
Adrian Prantl
b504c8771f Revert "[lldb] Add a compiler/interpreter of LLDB data formatter bytecode to examples"
This reverts commit 60380cd27c.
2024-12-06 16:26:55 -08:00
Adrian Prantl
60380cd27c [lldb] Add a compiler/interpreter of LLDB data formatter bytecode to examples
This PR adds a proof-of-concept for a bytecode designed to ship and
run LLDB data formatters. More motivation and context can be found in
the formatter-bytecode.rst file and on discourse.

https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696

Relanding with a fix for a case-sensitive path.
2024-12-06 16:10:09 -08:00
Adrian Prantl
8ab76a47b2 Revert "[lldb] Add a compiler/interpreter of LLDB data formatter bytecode to examples"
This reverts commit 7e3da87ca896484a11ac09df297183147154ac91.

I managed to break the bots.
2024-12-06 15:34:12 -08:00