summaryrefslogtreecommitdiff
path: root/lldb/docs/use/python-reference.rst
AgeCommit message (Collapse)Author
2025-10-09Add a scripted way to re-present a stop location (#158128)jimingham
This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327
2025-09-12[lldb/docs] Breakdown python reference into multiple files (#158331)Med Ismail Bennani
This pages improve the LLDB website documentation readability and discoverability by breaking down the very long python-reference page into multiple subpages each explaining a specific topic. The long term goal is to have tutorials for every scripting extension. This also converts the pages to markdown, since it's easier to write. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-07-20[lldb] Proofread python-reference.rst (#149643)Kazu Hirata
2025-05-25[lldb] Fix a typo in documentation (#141384)Kazu Hirata
2025-04-03[lldb] Update examples in docs/use/python-reference.rst to work with Python ↵Jonas Devlieghere
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-03-20[LLDB][NFC] Fix typo in docs (#131388)Kon
2024-09-24Add the ability to define custom completers to the parsed_cmd template. ↵jimingham
(#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-18Add docs and an example use of the scripted command get_flags API. (#109176)jimingham
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-07-03Add the ability for Script based commands to specify their "repeat command" ↵jimingham
(#94823) Among other things, returning an empty string as the repeat command disables auto-repeat, which can be useful for state-changing commands. There's one remaining refinement to this setup, which is that for parsed script commands, it should be possible to change an option value, or add a new option value that wasn't originally specified, then ask lldb "make this back into a command string". That would make doing fancy things with repeat commands easier. That capability isn't present in the lldb_private side either, however. So that's for a next iteration. I haven't added this to the docs on adding commands yet. I wanted to make sure this was an acceptable approach before I spend the time to do that.
2024-03-25Make the correct (5 argument) form of the command definition be the primary ↵jimingham
one suggested in the docs (#86593) This has been available for years now, so it should be safe to always use it.
2024-02-05[lldb][Docs] Remove unnecessary colon in titleDavid Spickett
2023-08-26[lldb/infra] Revamp lldb.llvm.orgMed Ismail Bennani
This patch brings a fresh coat of paint to the LLDB website. This uses the `furo` theme from the suggested theme list, adds some changes to the css to make it use the full browser window width and removes the table of contents since the theme generates it automatically. This patch also rewrites the tables for "GDB to LLDB command map" to convert them from raw HTML to native inlined code blocks. To generate the website, make sure you install the theme first with `pip install furo`, enable sphinx in the cmake invocation` then run `ninja docs-lldb-html` Discourse: https://discourse.llvm.org/t/rfc-revamping-lldbs-website Differential Revision: https://reviews.llvm.org/D158323 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-08-24Revert "[lldb/infra] Revamp lldb.llvm.org"Med Ismail Bennani
This patch reverts the lldb website revamp (eea8874) since the `furo` theme that we use is not installed on the publisher bot. The prevents other website from getting there documentation updated. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-08-24[lldb/infra] Revamp lldb.llvm.orgMed Ismail Bennani
This patch brings a fresh coat of paint to the LLDB website. This uses the `furo` theme from the suggested theme list, adds some changes to the css to make it use the full browser window width and removes the table of contents since the theme generates it automatically. This patch also rewrites the tables for "GDB to LLDB command map" to convert them from raw HTML to native inlined code blocks. To generate the website, make sure you install the theme first with `pip install furo`, enable sphinx in the cmake invocation` then run `ninja docs-lldb-html` Discourse: https://discourse.llvm.org/t/rfc-revamping-lldbs-website Differential Revision: https://reviews.llvm.org/D158323 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2022-09-13[lldb] Fixed a number of typosGabriel Ravier
I went over the output of the following mess of a command: (ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less) and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Differential revision: https://reviews.llvm.org/D131122
2022-09-06You can't use lldb.target in a frame recognizer.Jim Ingham
2022-08-07[lldb] Fix formatting in python-reference.rstDave Lee
2022-04-29Add a paragraph showing how to use container commands.Jim Ingham
Differential Revision: https://reviews.llvm.org/D124028
2022-01-13[lldb] Use __lldb_init_module instead of "if lldb.debugger" idiomDave Lee
Update examples and docs to demonstrate using `__lldb_init_module` instead of the idiom that checks for `lldb.debugger` at the top-level. ``` if __name__ == '__main__': ... elif lldb.debugger: ... ``` Is replaced with: ``` if __name__ == '__main__': ... def __lldb_init_module(debugger, internal_dict): ... ``` This change is for two reasons. First, it's generally encouraged not to only use the convenience singletons (`lldb.{debugger,process,target,etc}`) interactively from the `script` command. Second, there's a bug where registering a python class as a command (using `command script add -c ...`), result in the command not being runnable. Note that registering function-backed commands does not have this bug. Differential Revision: https://reviews.llvm.org/D117237
2021-11-11[lldb][NFC] Inclusive Language: rename master plan to controlling planQuinn Pham
[NFC] As part of using inclusive language within the llvm project, this patch renames master plan to controlling plan in lldb. Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D113019
2021-09-04[LLDB][Docs] Indicate `PS1` variable by $Shivam Gupta
2021-07-06[lldb][docs] Fix reference warnings in python-reference.rstRaphael Isemann
References with a single '`' around them are interpreted as references instead of text with monospaced font since the introduction of the new Python API generator. This meant that all the single-quoted code in this document that doesn't reference any Python class was throwing sphinx errors. This just adds the neede extra ` around this code and fixed up the legitimate typos (e.g. `SBframe` -> `SBFrame`).
2021-05-31[lldb] Fix typos. NFC.Bruce Mitchener
Differential Revision: https://reviews.llvm.org/D103381
2021-03-02[lldb] Extend Python convenience variable table with equivalent APIsJonas Devlieghere
Add a column to the table of convenience variables with the equivalent API to get to the current debugger, target, process, etc. We often get asked to make convenience variables available outside of the interactive interpreter. After explaining why that's not possible, a common complaint is that it's hard to find out how to get to these variables in a non-interactive context, for example how to get to the current frame when given a thread. This patch aims to alleviate that by including the APIs to navigate between these instances in the table. Differential revision: https://reviews.llvm.org/D97778
2021-03-01[lldb] Fix typos in documentation (NFC)Kazu Hirata
2021-02-25Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awkHarmen Stoppels
Allow users to use a non-system version of perl, python and awk, which is useful in certain package managers. Reviewed By: JDevlieghere, MaskRay Differential Revision: https://reviews.llvm.org/D95119
2021-02-09Use internal_dict everywhere we refer to the python session dict in docs.Jim Ingham
2021-02-09Add documentation for the extra_args parameter to breakpoint commands.Jim Ingham
Differential Revision: https://reviews.llvm.org/D96368
2021-02-01[Branch-Rename] Fix some linksxgupta
According to the [[ https://foundation.llvm.org/docs/branch-rename/ | status of branch rename ]], the master branch of the LLVM repository is removed on 28 Jan 2021. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D95766
2020-10-16Un-indent the section on 'Writing Target Stop-Hooks in Python'Jason Molenda
it was ending up in a code block from the previous section, instead of being its own section.
2020-09-29Revert "Revert "Add the ability to write target stop-hooks using the ↵Jim Ingham
ScriptInterpreter."" This reverts commit f775fe59640a2e837ad059a8f40e26989d4f9831. I fixed a return type error in the original patch that was causing a test failure. Also added a REQUIRES: python to the shell test so we'll skip this for people who build lldb w/o Python. Also added another test for the error printing.
2020-09-28Revert "Add the ability to write target stop-hooks using the ScriptInterpreter."Jonas Devlieghere
This temporarily reverts commit b65966cff65bfb66de59621347ffd97238d3f645 while Jim figures out why the test is failing on the bots.
2020-09-25Add the ability to write target stop-hooks using the ScriptInterpreter.Jim Ingham
Differential Revision: https://reviews.llvm.org/D88123
2019-07-09[Docs] Replace SVN revisions with lldb versionsDave Lee
Summary: Replaces references to svn commits with the lldb version number those commits first appeared in. Themotivation is to show that these features are no longer that new and can generally be adopted. Reviewers: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D61778 llvm-svn: 365559
2019-05-14Rename MacOS X -> macOS where applicable.Adrian Prantl
llvm-svn: 360691
2019-05-10[Docs] Fix table formatting in Pytho referenceJonas Devlieghere
llvm-svn: 360398
2019-05-09[Docs] Port python reference pageJonas Devlieghere
I somehow forgot to port over this page from the old website. Thank you Jim for the heads up! llvm-svn: 360386