Skip to content

Commit e43adae

Browse files
authored
[lldb][docs] Convert simple RST pages to Markdown (NFC) (#201256)
Convert nine short, low-risk RST docs to MyST Markdown as the first batch of an incremental RST -> Markdown migration. Subsequent batches will cover the rest. Verified by building the docs on origin/main and on this branch with identical sphinx flags and diffing the rendered HTML. Seven of nine pages are byte-identical. contributing.html differs in 42 lines, all attributable to `{doc}` xrefs replacing RST hyperlinks to sibling pages (`reference external` -> `reference internal`) and CommonMark collapsing two-spaces-after- period to one. ondemand.html differs in 26 lines because two bulleted lists that followed a paragraph with no blank-line separator originally rendered as literal `- ...` text in both RST and Markdown. The conversion tool preserved that by emitting `\-`; this patch instead inserts a blank line so they render as proper `<ul>` lists, fixing a latent doc bug. Context: https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/ Assisted-by: Claude
1 parent 09020f9 commit e43adae

14 files changed

Lines changed: 439 additions & 484 deletions

lldb/docs/python_api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# LLDB Python API
2+
3+
% The long list of "skip" filters out several global functions that are
4+
% generated by SWIG (but which are not useful as they are only the
5+
% backend for their respective static functions in the classes).
6+
7+
```{eval-rst}
8+
.. automodapi:: lldb
9+
:no-inheritance-diagram:
10+
:skip: command
11+
:skip: declaration
12+
:skip: in_range
13+
:skip: is_numeric_type
14+
:skip: lldb_iter
15+
```

lldb/docs/python_api.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
1-
Python Extensions
2-
=================
1+
# Python Extensions
32

43
LLDB provides scriptable extensions to augment the debugger's capabilities.
54
This gives users the ability to tailor their debugging experience to their own needs.
65

76
This page describes some of these scripting extensions:
87

9-
Operating System Thread Plugins
10-
-------------------------------
8+
## Operating System Thread Plugins
119

10+
```{eval-rst}
1211
.. automodapi:: lldb.plugins.operating_system
1312
:no-heading:
1413
:skip: ScriptedThread
1514
:no-inheritance-diagram:
15+
```
1616

17-
Scripted Frame Provider Plugins
18-
-------------------------------
17+
## Scripted Frame Provider Plugins
1918

19+
```{eval-rst}
2020
.. automodapi:: lldb.plugins.scripted_frame_provider
2121
:no-heading:
2222
:skip: ABCMeta
2323
:no-inheritance-diagram:
24+
```
2425

25-
Scripted Process Plugins
26-
-------------------------------
26+
## Scripted Process Plugins
2727

28+
```{eval-rst}
2829
.. automodapi:: lldb.plugins.scripted_process
2930
:no-heading:
3031
:skip: ABCMeta
3132
:no-inheritance-diagram:
33+
```
3234

33-
Scripted Platform Plugins
34-
-------------------------------
35+
## Scripted Platform Plugins
3536

37+
```{eval-rst}
3638
.. automodapi:: lldb.plugins.scripted_platform
3739
:no-heading:
3840
:skip: ABCMeta
3941
:no-inheritance-diagram:
42+
```
4043

41-
Scripted Thread Plan Plugins
42-
-------------------------------
44+
## Scripted Thread Plan Plugins
4345

46+
```{eval-rst}
4447
.. automodapi:: lldb.plugins.scripted_thread_plan
4548
:no-heading:
4649
:no-inheritance-diagram:
47-
50+
```

lldb/docs/resources/caveats.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Caveats
2+
3+
(python_caveat)=
4+
5+
## Python
6+
7+
LLDB has a powerful scripting interface which is accessible through Python.
8+
Python is available either from within LLDB through a (interactive) script
9+
interpreter, or as a Python module which you can import from the Python
10+
interpreter.
11+
12+
To make this possible, LLDB links against the Python shared library. Linking
13+
against Python comes with some constraints to be aware of.
14+
15+
1. It is not possible to build and link LLDB against a Python 3 library and
16+
use it from Python 2 and vice versa.
17+
2. It is not possible to build and link LLDB against one distribution on
18+
Python and use it through an interpreter coming from another distribution.
19+
For example, on macOS, if you build and link against Python from
20+
python.org, you cannot import the lldb module from the Python interpreter
21+
installed with Homebrew.
22+
3. To use third party Python packages from inside LLDB, you need to install
23+
them using a utility (such as `pip`) from the same Python distribution as
24+
the one used to build and link LLDB.
25+
26+
The previous considerations are especially important during development, but
27+
apply to binary distributions of LLDB as well.
28+
29+
### LLDB in Xcode on macOS
30+
31+
Users of lldb in Xcode on macOS commonly run into these issues when they
32+
install Python, often unknowingly as a dependency pulled in by Homebrew or
33+
other package managers. The problem is the symlinks that get created in
34+
`/usr/local/bin`, which comes before `/usr/bin` in your path. You can use
35+
`which python3` to check to what it resolves.
36+
37+
To be sure you use the Python that matches with the lldb in Xcode use `xcrun`
38+
or use the absolute path to the shims in `/usr/bin`.
39+
40+
```
41+
$ xcrun python3
42+
$ /usr/bin/python3
43+
```
44+
45+
Similarly, to install packages and be able to use them from within lldb, you'll
46+
need to install them with the matching `pip3`.
47+
48+
```
49+
$ xcrun pip3
50+
$ /usr/bin/pip3
51+
```
52+
53+
The same is true for Python 2. Although Python 2 comes with the operating
54+
system rather than Xcode, you can still use `xcrun` to launch the system
55+
variant.
56+
57+
```
58+
$ xcrun python
59+
$ /usr/bin/python
60+
```
61+
62+
Keep in mind that Python 2 is deprecated and no longer maintained. Future
63+
versions of macOS will not include Python 2.7.

lldb/docs/resources/caveats.rst

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)