Skip to content

Commit 5c5711d

Browse files
committed
Proofread and update python docs following general conventions. Part 3
1 parent 632770f commit 5c5711d

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

docs/user/Tooling.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
11
# Tooling Support for Python
22

3-
The GraalVM's Python implementation is incomplete and cannot launch the standard Python
4-
debugger `pdb`. However, it can run the tools that GraalVM provides.
5-
The `graalpython --help:tools` command will give you more information
6-
about tools currently supported on Python.
7-
8-
### Debugger
9-
To enable debugging, pass the `--inspect` option to the `graalpython`
10-
launcher. For example:
3+
GraalVM's Python implementation is incomplete and cannot launch the standard Python debugger `pdb`.
4+
However, it can run the tools that GraalVM provides.
5+
The `graalpython --help:tools` command will give you more information about tools currently supported on Python.
6+
7+
## Debugger
8+
9+
To enable debugging, pass the `--inspect` option to the `graalpython` launcher.
10+
For example:
1111
```shell
1212
graalpython --inspect -c "breakpoint(); import os; os.exit()"
1313
Debugger listening on port 9229.
1414
To start debugging, open the following URL in Chrome:
1515
chrome-devtools://devtools/bundled/js_app.html?ws=127.0.1.1:9229/76fcb6dd-35267eb09c3
1616
```
17-
As you see, the standard Python built-in `breakpoint()` will work with our
18-
debugger. You can inspect variables, set watch expressions, interactively
19-
evaluate code snippets etc. However, this only works if you pass `--inspect` or
20-
some other inspect option. Otherwise, `pdb` is triggered as on CPython (and
21-
does not currently work).
22-
23-
### Coverage
24-
GraalVM comes with a coverage instrument that can be used with `--coverage`. The
25-
the `graalpython --help:tools` command line help for more details on how to use
26-
it. In order to work better with existing Python code, we also partially support
27-
the standard library `trace` module with this low-overhead GraalVM coverage
28-
instrument. So you can do this:
17+
18+
The standard Python built-in `breakpoint()` will work using the [GraalVM's Chrome Inspector](https://www.graalvm.org/tools/chrome-debugger/) implementation.
19+
You can inspect variables, set watch expressions, interactively evaluate code snippets, etc.
20+
However, this only works if you pass `--inspect` or some other inspect option. Otherwise, `pdb` is triggered as on CPython (and does not currently work).
21+
22+
## Code Coverage
23+
24+
GraalVM comes with a coverage instrument that can be used with `--coverage`.
25+
Use the `graalpython --help:tools` command to see details on how to use it.
26+
27+
In order to work better with existing Python code, the standard library `trace` module is partially supported with this low-overhead GraalVM coverage instrument.
28+
So you can do this:
2929
```shell
3030
graalpython -m trace -m -c -s my_script.py
3131
```
32-
This will work similarly to how it will run on CPython. The programmatic API
33-
also works, with some limitations. For example, it does not currently track calls,
34-
only line counts and called functions.
35-
36-
### Profiling
37-
The `_lsprof` built-in module has been implemented using the GraalVM `cpusampler`
38-
tool. Not all profiling features are currently supported, but basic profiling
39-
works:
32+
33+
This will work similarly to how it would run on CPython.
34+
35+
The programmatic API also works, with some limitations.
36+
For example, it does not currently track calls, only line counts and called functions.
37+
38+
## Profiling
39+
40+
The `_lsprof` built-in module has been implemented using the GraalVM `cpusampler` tool.
41+
Not all profiling features are currently supported, but basic profiling works:
4042
```shell
4143
graalpython -m cProfile -s sort -m ginstall --help
4244
```
45+
4346
The interactive exploration of a stats output file also works:
4447
```shell
4548
graalpython -m cProfile -o ginstall.profile -m ginstall --help

0 commit comments

Comments
 (0)