Update debugging.md

This commit is contained in:
Fabricio Voznika 2019-08-01 09:41:26 -07:00 committed by Ian Lewis
parent 6ee109aca4
commit e06142e033
1 changed files with 5 additions and 5 deletions

View File

@ -59,10 +59,13 @@ sudo runsc --root /var/run/docker/runtime-runsc/moby debug --stacks 63254c6ab3a6
## Debugger
You can debug gVisor like any other Golang program. If you're running with Docker,
you'll need to find the sandbox PID and attach the debugger as root. Other than
that, it's business as usual.
you'll need to find the sandbox PID and attach the debugger as root. Here is an
example:
```bash
# Get a runsc with debug symbols (download nightly or build with symbols).
bazel build -c dbg //runsc:runsc
# Start the container you want to debug.
docker run --runtime=runsc --rm --name=test -d alpine sleep 1000
@ -77,9 +80,6 @@ break mm.MemoryManager.MMap
continue
```
> Note: if the debugger cannot find symbols, rebuild runsc in debug mode:
> `bazel build -c dbg //runsc:runsc`
## Profiling
`runsc` integrates with Go profiling tools and gives you easy commands to profile