Repository navigation
scripts: add debug build to fuzz.sh #9375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ Usage: | |
| relatively verbose stderr is not redirected by -o. | ||
| -j n Number of concurrent -jobs=n. Defaults to 1. | ||
| The value 0 uses the output of the 'nproc' command. | ||
| -d Add debug optimizations and symbols to the build. | ||
| Useful for testcase reproduction. | ||
|
|
||
| Arguments after -- are passed as is to CMake (through west). | ||
| When passing conflicting -DVAR='VAL UE1' -DVAR='VAL UE2' to CMake, | ||
|
|
@@ -85,16 +87,18 @@ main() | |
| local BUILD_ONLY=false | ||
| local FUZZER_STDOUT=/dev/stdout # bashism | ||
| local TEST_DURATION=3 | ||
| local DEBUG_BUILD=false | ||
|
|
||
| # Parse "$@". getopts stops after '--' | ||
| while getopts "hj:po:t:b" opt; do | ||
| while getopts "hj:po:t:bd" opt; do | ||
| case "$opt" in | ||
| h) print_help; exit 0;; | ||
| j) if [ "$OPTARG" -eq 0 ]; then JOBS=$(nproc); else JOBS="$OPTARG"; fi;; | ||
| p) PRISTINE=true;; | ||
| o) FUZZER_STDOUT="$OPTARG";; | ||
| t) TEST_DURATION="$OPTARG";; | ||
| b) BUILD_ONLY=true;; | ||
| d) DEBUG_BUILD=true;; | ||
| *) print_help; exit 1;; | ||
| esac | ||
| done | ||
|
|
@@ -116,6 +120,14 @@ main() | |
| -DCONFIG_ASAN=y | ||
| ) | ||
|
|
||
| local debug_configs=( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's pretty amazing that this does NOT git conflict considering I removed the entire Even if not a git conflict, this is still very much a logical conflict so this PR should not be merged as is right now. There will likely be another conflict with incoming #9409, so maybe wait for that to be merged too. |
||
| -DCONFIG_DEBUG=y | ||
| -DCONFIG_DEBUG_OPTIMIZATIONS=y | ||
| ) | ||
|
|
||
| # append debug flags if a debug build | ||
| if $DEBUG_BUILD; then fuzz_configs=( "${fuzz_configs[@]}" "${debug_configs[@]}" ); fi | ||
|
marc-hb marked this conversation as resolved.
|
||
|
|
||
| # Note there's never any reason to delete fuzz_corpus/. | ||
| # Don't trust `west build -p` because it is not 100% unreliable, | ||
| # especially not when doing unusual toolchain things. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add these CONFIG_DEBUG* always? Are they slowing anything down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my thought that it would reduce the exec/s of the fuzzer. The build already has enough to get a stack trace so I didnt think it needed anymore since the automated tools don't do anything more.