572 Commits

Author SHA1 Message Date
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 60380cd27c6fa5ed6e39866c51b18a64bc4d566a.
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
Adrian Prantl
0ee364d2a2
[lldb] Add a compiler/interpreter of LLDB data formatter bytecode to lldb/examples (#113398)
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.md` file and on discourse.

https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696
2024-12-06 15:11:21 -08:00
David Spickett
84fec7757e [lldb][docs] Clarify unit for SVE P register size 2024-11-25 09:53:15 +00:00
Adrian Prantl
5681f756c0 Fix broken link 2024-11-19 13:01:08 -08:00
Adrian Prantl
61057b0f6f
[lldb/www] Garbage collect old videos and add new ones (#116838)
Fixes #66476
2024-11-19 11:06:16 -08:00
David Spickett
3ce0dbb718
[lldb] Recommend Python 3.8 as the minimum Python version for LLDB (#114807)
See
https://discourse.llvm.org/t/rfc-lets-document-and-enforce-a-minimum-python-version-for-lldb/82731
for discussions.

This matches LLVM's requirement to run tests. For LLDB 20 there will be
a CMake warning telling builders that from LLDB 21 this will be a hard
requirement. From LLDB 21, it will be an error to try to build with
anything <= 3.8.

So there are no code changes in this commit. Once the llvm 20 branch is
created we can remove some < 3.8 support code.

As always, if you disable Python support you will not get any new
warnings or errors from this change.
2024-11-12 10:49:16 +00:00
Jonas Devlieghere
e19d740169
[lldb] Support both Lua 5.3 and Lua 5.4 (#115500)
Lua 5.3 and Lua 5.4 are similar enough that we can easily support both
in LLDB. This patch adds support for building LLDB with both and updates
the documentation accordingly.
2024-11-11 08:11:03 -08:00
Jonas Devlieghere
3a782ef97d
[lldb] Add a link to LLDB's Discord channel on the website (#114289)
Looking at #114276, I realized we have a link to Discourse on the
website, but not Discord. I think it would be helpful to have that link
there for real-time community discussion.
2024-10-30 15:47:48 -07:00
Jonas Devlieghere
2ab98dfe19
[lldb] Update link to GreenDragon in the docs 2024-10-29 09:45:29 -07:00
Michael Buch
7b703bd3e7
[lldb][docs] Fix "Developing LLDB" table of contents (#113166)
Currently all the headings marked as `#` show up
as a top-level entry in the `Developing LLDB`
toctree. This patch marks these as `##` so only
`Adding Programming Language Support` is displayed
in the table of contents.
2024-10-21 22:19:26 +01:00
Jonas Devlieghere
6e02e19cd3
[lldb][docs] Add JSON symbol file docs to the ToC 2024-10-18 14:22:54 -07:00
Jonas Devlieghere
7437f3ef7e
[lldb] Document SymbolFileJSON (#112938)
I've had multiple request for documentation about the JSON symbol file
format that LLDB supports. This patch documents the structure and
fields, shows a handful of examples and explains how to use it in LLDB.
2024-10-18 13:24:15 -07:00
Jason Molenda
9c6f85f57a [lldb][NFC] fix two small typeos in aarch64-linxu.md 2024-10-17 19:46:08 -07:00
David Spickett
2882bb192b [lldb][docs] Add link to LoongArch tracking issue
https://github.com/llvm/llvm-project/issues/112693 will be
tracking the overall state of LoongArch support.

This means anyone can check without having to track down
an expert.
2024-10-17 12:48:03 +01:00
David Spickett
993de5512d [lldb][docs] Add link to RISC-V tracking issue in Platform Support
Saves me searching for this every time someone asks.
2024-10-10 10:21:41 +01:00
苏灵素@夏日限定
646aa817d2
[lldb][Docs] Fix typo in tutorial.rst (#111326) 2024-10-07 21:29:39 -07:00
Vladislav Dzhidzhoev
32e90bbe57
[lldb][test] Support remote run of Shell tests (#95986)
1. This commit adds LLDB_TEST_PLATFORM_URL, LLDB_TEST_SYSROOT,
LLDB_TEST_PLATFORM_WORKING_DIR, LLDB_SHELL_TESTS_DISABLE_REMOTE cmake
flags to pass arguments for cross-compilation and remote running of both Shell&API tests.
2. To run Shell tests remotely, it adds 'platform select' and 'platform connect' commands to %lldb
substitution.
3. 'remote-linux' feature added to lit to disable tests failing with
remote execution.
4. A separate working directory is assigned to each test to avoid
conflicts during parallel test execution.
5. Remote Shell testing is run only when LLDB_TEST_SYSROOT is set for
building test sources. The recommended compiler for that is Clang.

---------

Co-authored-by: Vladimir Vereschaka <vvereschaka@accesssoftek.com>
2024-10-07 20:31:33 +02:00
Adrian Vogelsgesang
6c137b75f3
[lldb-dap][docs] Improve documentation for contributors (#110987)
This commit extends the developer docs for `lldb-dap`. It also adds a
short "Contributing" section to the user-facing README.

Last but not least, it updates the `repository` in the package.json to
point to the actual source of truth for the source code, instead of
pointing to its mirrored repository. I hope that the VS Code Marketplace
properly supports the `directory` property. Unfortunately, I have no way
to test this before merging this Pull Request.
2024-10-03 19:51:34 +02:00
Dmitry Vasilyev
2e89312419
[lldb] Removed gdbserver ports map from lldb-server (#104238)
Listen to gdbserver-port, accept the connection and run `lldb-server gdbserver --fd` on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of #101283.

Fixes #97537.
2024-10-03 21:00:47 +04:00
jimingham
a4197e4728
Add docs describing how the thread plan stack affects stepping (#110167)
This is a convenient little feature of lldb, but if you didn't know it
was there you'd likely never discover it.
2024-09-27 09:36:52 -07:00
David Spickett
f6e771cfed [lldb][Docs] Convert AArch64 Linux doc to Markdown
Executive decision from me given that I am the sole author
of the doc and there's nothing Markdown can't handle here.
2024-09-27 13:31:58 +01:00
jimingham
04b443e778
Add the ability to define custom completers to the parsed_cmd template. (#109062)
If your arguments or option values are of a type that naturally uses one
of our common completion mechanisms, you will get completion for free.
But if you have your own custom values or if you want to do fancy things
like have `break set -s foo.dylib -n ba<TAB>` only complete on symbols
in foo.dylib, you can use this new mechanism to achieve that.
2024-09-24 10:00:00 -07:00
David Spickett
a3cf01d585
[lldb][docs] Resurrect the information on adding a new language (#109427)
This got deleted in e078c9507c3abb4d9bb2265c366b26557880a3e3, I presume
accidentally, because it didn't have a corresponding rst file for it.

So I've brought it back and converted it into Markdown. The content
remains accurate, from what I know at least.

It's a bit "now draw the rest of the owl" but if nothing else, it gives
you a bunch of important classes to go and research as a starting point.

You can see the original content here:
5d71fc5d7b/lldb/www/adding-language-support.html
2024-09-24 11:21:24 +01:00
jimingham
615bd9ee60
Add docs and an example use of the scripted command get_flags API. (#109176)
The API is present, and we even have a test for it, but it isn't
documented so no one probably knows you can set requirements for your
scripted commands. This just adds docs and uses it appropriately in the
`framestats` example command.
2024-09-18 18:10:43 -07:00
jimingham
02d8813820
Add a comment in the SB API doc about keeping the SB API's lightweight. (#108462) 2024-09-13 10:18:03 -07:00
David Spickett
77b388cfc6 [lldb][Docs] Fix broken link to qemu testing page 2024-09-06 09:31:19 +01:00
Scott Linder
18cf14efe3 [Docs] Use cacheable myst_heading_slug_func value
Avoid creating an uncacheable conf variable by using a string instead of
a function reference. Also has the effect of avoiding triggering the
"config.cache" sphinx warning.

Requires myst_parser 0.19.0 (specifically
https://github.com/executablebooks/MyST-Parser/pull/696) which is over a
year old by now. Do we mandate any minimum version for these
dependencies?
2024-09-03 22:05:03 +00:00
Med Ismail Bennani
8334d2bfd3
[lldb/Interpreter] Fix ambiguous partial command resolution (#101934)
This patch is a follow-up to #97263 that fix ambigous abbreviated
command resolution.

When multiple commands are resolved, instead of failing to pick a
command to
run, this patch changes to resolution logic to check if there is a
single
alias match and if so, it will run the alias instead of the other
matches.

This has as a side-effect that we don't need to make aliases for every
substring of aliases to support abbrivated alias resolution.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-08-08 12:55:10 -07:00
David Spickett
2771ce80f8
[lldb][Docs] Add edit link to docs pages (#102144)
That aren't the generated `python_api/` pages.

This button is a pencil icon at the top right of the page and takes you
to a GitHub page where you can edit the content, assuming you have a
fork already. If not it tells you how to make one.

This is hardcoded to the llvm-project URL and main branch. So folks will
need a downstream patch if they want to change that.

For the upstream repo, main is right because even if a release branch
was open for PRs, it would only be for cherry picks from main.

The icon isn't as obvious as the "edit on GitHub" icons seen elsewhere
but it's built in, and we could change it later if we wanted to.
2024-08-08 09:48:50 +01:00
Jason Molenda
2ba1aeed2e
[lldb] Don't use a vm addr range starting at 0 for local memory (#100288)
When an inferior stub cannot allocate memory for lldb, and lldb needs to
store the result of expressions, it will do it in lldb's own memory
range ("host memory"). But it needs to find a virtual address range that
is not used in the inferior process. It tries to use the
qMemoryRegionInfo gdb remote serial protocol packet to find a range that
is inaccessible, starting at address 0 and moving up the size of each
region.

If the first region found at address 0 is inaccessible, lldb will use
the address range starting at 0 to mean "read lldb's host memory, not
the process memory", and programs that crash with a null dereference
will have poor behavior.

This patch skips consideration of a memory region that starts at address
0.

I also clarified the documentation of qMemoryRegionInfo to make it clear
that the stub is required to provide permissions for a memory range that
is accessable, it is not an optional key in this response. This issue
was originally found by a stub that did not list permissions in its
response, and lldb treated the first region returned as the one it would
use. (the stub also didn't support the memory-allocate packet)
2024-07-24 17:25:57 -07:00
David Spickett
d4a89af5a8 [lldb][Docs] Move QEMU testing page into the developing lldb section 2024-07-16 13:08:04 +01:00
Alan Zhao
43024a4651
[lldb][man][nfc] Don't register a markdown parser when building man packages (#98420)
This reduces Sphinx dependencies for building lldb man pages as lldb man
pages don't use markdown.
2024-07-11 12:54:26 -07:00