Skip to content

Commit b1ef2db

Browse files
committed
[lldb][docs] Fix header level warnings in a few documents
All these are using H1 for the main heading but H3 for the rest, Sphinx warns about this: WARNING: Non-consecutive header level increase; H1 to H3 [myst.header]
1 parent afb3852 commit b1ef2db

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

lldb/docs/use/tutorials/creating-custom-breakpoints.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ happens when a location triggers and includes the commands, conditions, ignore
2020
counts, etc. Stop options are common between all breakpoint types, so for our
2121
purposes only the Searcher and Resolver are relevant.
2222

23-
### Breakpoint Searcher
23+
## Breakpoint Searcher
2424

2525
The Searcher's job is to traverse in a structured way the code in the current
2626
target. It proceeds from the Target, to search all the Modules in the Target,
@@ -36,7 +36,7 @@ based search filter. If neither of these is specified, the breakpoint will have
3636
a no-op search filter, so all parts of the program are searched and all
3737
locations accepted.
3838

39-
### Breakpoint Resolver
39+
## Breakpoint Resolver
4040

4141
The Resolver has two functions:
4242

@@ -72,7 +72,7 @@ you add to the breakpoint yourself. Note that the Breakpoint takes care of
7272
deduplicating equal addresses in AddLocation, so you shouldn't need to worry
7373
about that anyway.
7474

75-
### Scripted Breakpoint Resolver
75+
## Scripted Breakpoint Resolver
7676

7777
At present, when adding a ScriptedBreakpoint type, you can only provide a
7878
custom Resolver, not a custom SearchFilter.
@@ -127,7 +127,7 @@ of Modules and the list of CompileUnits that will make up the SearchFilter. If
127127
you pass in empty lists, the breakpoint will use the default "search
128128
everywhere,accept everything" filter.
129129

130-
### Providing Facade Locations:
130+
## Providing Facade Locations:
131131

132132
The breakpoint resolver interface also allows you to present a separate set
133133
of locations for the breakpoint than the ones that actually implement the

lldb/docs/use/tutorials/implementing-standalone-scripts.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Implementing Standalone Scripts
22

3-
### Configuring `PYTHONPATH`
3+
## Configuring `PYTHONPATH`
44

55
LLDB has all of its core code built into a shared library which gets used by
66
the `lldb` command line application.
@@ -30,7 +30,7 @@ $ export PYTHONPATH=`lldb -P`
3030
Alternatively, you can append the LLDB Python directory to the sys.path list
3131
directly in your Python code before importing the lldb module.
3232

33-
### Initialization
33+
## Initialization
3434

3535
The standard test for `__main__`, like many python modules do, is useful for
3636
creating scripts that can be run from the command line. However, for command
@@ -56,7 +56,7 @@ if __name__ == '__main__':
5656
lldb.SBDebugger.Terminate()
5757
```
5858

59-
### Example
59+
## Example
6060

6161
Now your python scripts are ready to import the lldb module. Below is a python
6262
script that will launch a program from the current working directory called
@@ -133,7 +133,7 @@ if target:
133133
print(symbol)
134134
```
135135

136-
### Expected Output
136+
## Expected Output
137137

138138
Exact output varies by system, but you should see something like this:
139139

@@ -148,7 +148,7 @@ a.out[0x714]: mov w0, #0x0 ; =0
148148
a.out[0x718]: ret
149149
```
150150

151-
### Troubleshooting
151+
## Troubleshooting
152152

153153
You can use all the usual Python tools to debug scripts, and on top of that
154154
you can enable LLDB's log channels. To do this in the script shown above, add

lldb/docs/use/tutorials/script-driven-debugging.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document will show how to do some of these things by going through an
1212
example, explaining how to use Python scripting to find a bug in a program
1313
that searches for text in a large binary tree.
1414

15-
### The Test Program and Input
15+
## The Test Program and Input
1616

1717
We have a simple C program ([dictionary.c](https://github.com/llvm/llvm-project/blob/main/lldb/examples/scripting/dictionary.c))
1818
that reads in a text file, and stores all the words from the file in a
@@ -24,7 +24,7 @@ the word in the tree.
2424
The input text file we are using to test our program contains the text
2525
for William Shakespeare's famous tragedy "Romeo and Juliet".
2626

27-
### The Bug
27+
## The Bug
2828

2929
When we try running our program, we find there is a problem. While it
3030
successfully finds some of the words we would expect to find, such as
@@ -44,7 +44,7 @@ Enter search word: ^D
4444
$
4545
```
4646

47-
### Using Depth First Search
47+
## Using Depth First Search
4848

4949
Our first job is to determine if the word "Romeo" actually got inserted
5050
into the tree or not. Since "Romeo and Juliet" has thousands of words,
@@ -86,7 +86,7 @@ later explanations:
8686
25: return DFS (right_child_ptr, word, cur_path)
8787
```
8888

89-
### Accessing & Manipulating Program Variables
89+
## Accessing & Manipulating Program Variables
9090

9191
Before we can call any Python function on any of our program's
9292
variables, we need to get the variable into a form that Python can
@@ -126,7 +126,7 @@ information or children values out of SBValues. For complete information, see
126126
the header file SBValue.h. The `SBValue` methods that we use in our DFS function
127127
are `GetChildMemberWithName()`, `GetSummary()`, and `GetValue()`.
128128

129-
### Explaining DFS Script in Detail
129+
## Explaining DFS Script in Detail
130130

131131
Before diving into the details of this code, it would be best to give a
132132
high-level overview of what it does. The nodes in our binary search tree were
@@ -166,7 +166,7 @@ start all over. Therefore we recommend doing as we have done: Writing your
166166
longer, more complicated script functions in a separate file (in this case
167167
tree_utils.py) and then importing it into your LLDB Python interpreter.
168168

169-
### The DFS Script in Action
169+
## The DFS Script in Action
170170

171171
At this point we are ready to use the DFS function to see if the word "Romeo"
172172
is in our tree or not. To actually use it in LLDB on our dictionary program,
@@ -261,7 +261,7 @@ From this we can see that the word "Romeo" was indeed found in the tree, and
261261
the path from the root of the tree to the node containing "Romeo" is
262262
left-left-right-right-left.
263263

264-
### Using Breakpoint Command Scripts
264+
## Using Breakpoint Command Scripts
265265

266266
We are halfway to figuring out what the problem is. We know the word we are
267267
looking for is in the binary tree, and we know exactly where it is in the
@@ -282,7 +282,7 @@ being hit. But if the decision differs from what the path says it should be,
282282
then the script prints out a message and does NOT resume execution, leaving the
283283
user sitting at the first point where a wrong decision is being made.
284284

285-
### Python Breakpoint Command Scripts Are Not What They Seem
285+
## Python Breakpoint Command Scripts Are Not What They Seem
286286

287287
What do we mean by that? When you enter a Python breakpoint command in LLDB, it
288288
appears that you are entering one or more plain lines of Python. BUT LLDB then
@@ -305,7 +305,7 @@ automatically have a frame and a bp_loc variable. The variables are pre-loaded
305305
by LLDB with the correct context for the breakpoint. You do not have to use
306306
these variables, but they are there if you want them.
307307

308-
### The Decision Point Breakpoint Commands
308+
## The Decision Point Breakpoint Commands
309309

310310
This is what the Python breakpoint command script would look like for the
311311
decision to go right:
@@ -358,7 +358,7 @@ execution. We allow the breakpoint to remain stopped (by doing nothing), and we
358358
print an informational message telling the user we have found the problem, and
359359
what the problem is.
360360

361-
### Actually Using The Breakpoint Commands
361+
## Actually Using The Breakpoint Commands
362362

363363
Now we will look at what happens when we actually use these breakpoint commands
364364
on our program. Doing a source list -n find_word shows us the function
@@ -480,7 +480,7 @@ case conversion problem somewhere in our program (we do).
480480
This is the end of our example on how you might use Python scripting in LLDB to
481481
help you find bugs in your program.
482482

483-
### Sources
483+
## Sources
484484

485485
The complete code for the Dictionary program (with case-conversion bug), the
486486
DFS function and other Python script examples used for this example are

lldb/docs/use/tutorials/writing-custom-commands.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Writing Custom Commands
22

3-
### Create a new command using a Python function
3+
## Create a new command using a Python function
44

55
Python functions can be used to create new LLDB command interpreter commands,
66
which will work like all the natively defined lldb commands. This provides a
@@ -51,7 +51,7 @@ command definition form can't do the right thing.
5151
| `result` | `lldb.SBCommandReturnObject` | A return object which encapsulates success/failure information for the command and output text that needs to be printed as a result of the command. The plain Python "print" command also works but text won't go in the result by default (it is useful as a temporary logging facility). |
5252
| `internal_dict` | `python dict object` | The dictionary for the current embedded script session which contains all variables and functions. |
5353

54-
### Create a new command using a Python class
54+
## Create a new command using a Python class
5555

5656
Since lldb 3.7, Python commands can also be implemented by means of a class
5757
which should implement the following interface:
@@ -103,7 +103,7 @@ print("my command does lots of cool stuff", file=result)
103103
`SBCommandReturnObject` and `SBStream` both support this file-like behavior by
104104
providing `write()` and `flush()` calls at the Python layer.
105105

106-
### Parsed Commands
106+
## Parsed Commands
107107

108108
The commands that are added using this class definition are what lldb calls
109109
"raw" commands. The command interpreter doesn't attempt to parse the command,
@@ -207,7 +207,7 @@ Mostly useful for handle_completion where you get passed the long option.
207207
"""
208208
```
209209

210-
### Completion
210+
## Completion
211211

212212
lldb will handle completing your option names, and all your enum values
213213
automatically. If your option or argument types have associated built-in completers,
@@ -280,7 +280,7 @@ You can optionally include a "descriptions" key, whose value is a parallel array
280280
of description strings, and the completion will show the description next to
281281
each completion.
282282

283-
### Loading Commands
283+
## Loading Commands
284284

285285
One other handy convenience when defining lldb command-line commands is the
286286
command "command script import" which will import a module specified by file
@@ -309,7 +309,7 @@ def goodstuff(debugger, command, ctx, result, internal_dict):
309309
# Command Implementation code goes here
310310
```
311311

312-
### Examples
312+
## Examples
313313

314314
Now we can create a module called ls.py in the file ~/ls.py that will implement
315315
a function that can be used by LLDB's python command code:

0 commit comments

Comments
 (0)