Skip to content

Commit 53c4788

Browse files
docs: Add debugging advice (#5517)
1 parent 4e4d69a commit 53c4788

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ In general, you use
106106
tox -p auto -o -e <tox_env> -- <pytest_args>
107107
```
108108

109+
## Debugging
110+
111+
Normal Python breakpoints using `breakpoint()` will drop you into `pdb` by default.
112+
To inspect C applications like uWSGI or extension module code at runtime, `lldb` is useful.
113+
For example, to debug a Django application that interfaces with uWSGI, build uWSGI with debug symbols using
114+
115+
```bash
116+
CFLAGS="-g -O0" python uwsgiconfig.py --build
117+
```
118+
119+
and then run the Django app with `lldb` using a command analogous to the following (with paths updated)
120+
121+
```bash
122+
lldb -- ../../uwsgi/uwsgi --pythonpath "$PWD/.venv/lib/python3.14/site-packages" \
123+
--http :8000 \
124+
--module mysite.wsgi:application \
125+
--home "$PWD/.venv" \
126+
--need-app \
127+
```
128+
109129
## Adding a New Integration
110130

111131
### SDK Contract

0 commit comments

Comments
 (0)