diff options
author | 2018-07-16 14:04:41 +1000 | |
---|---|---|
committer | 2018-07-16 14:04:41 +1000 | |
commit | d69a8ea80da1611e55d1e9a441087568ecbd86f6 (patch) | |
tree | 6efeed287e300bc004a2bdb06ef173096f431e86 /docs | |
parent | bcf02076e67beb867a76eb4719f03d64165aff33 (diff) |
Fix GDB documentation. (#1613)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/debugging.md | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/docs/debugging.md b/docs/debugging.md index 4e97aadb..25fdb516 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -10,9 +10,20 @@ $ compile # run compilation manually ## Debugging Fuzzers with GDB -If you decide to debug a fuzzer with gdb (which is already installed in base-runner-debug image), -you will need to start a container in privileged mode: +If you wish to debug a fuzz target with gdb, you may use the base-runner-debug +image: ```bash -docker run -ti --privileged -v /tmp/out:/out gcr.io/oss-fuzz-base/base-runner-debug gdb /out/<fuzz_target_name> +# Copy input testcase into host output directory so that it can be accessed +# within the Docker image. +$ cp /path/to/testcase build/out/$PROJECT_NAME + +# Run Docker image containing GDB. +$ python infra/helper.py shell base-runner-debug +$ gdb --args /out/$PROJECT_NAME/$FUZZ_TARGET_NAME /out/$PROJECT_NAME/testcase ``` + +Note that the base-runner-debug image does not have access to your sources, so +you will not be able to do source code level debugging. We recommend integrating +your fuzz target upstream as part of [ideal integration](ideal_integration.md) +for debugging purposes. |