Debugging issues
Debugging build scripts
While developing your build script, it may be useful to run bash within the container:
$ python infra/helper.py shell $PROJECT_NAME # runs /bin/bash within container
$ compile # runs compilation manually
Debugging fuzzers with GDB
If you wish to debug a fuzz target with gdb, you can use the base-runner-debug image:
# Copy input testcase into host output directory so it can be accessed
# within the Docker image.
$ cp /path/to/testcase build/out/$PROJECT_NAME
# Run the 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: 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 for debugging purposes.