Skip to content

Commit

Permalink
Merge pull request #71 from Wenzel/fix/debug_action
Browse files Browse the repository at this point in the history
config: move action as required argument for debug subcommand only
  • Loading branch information
Wenzel authored Sep 6, 2023
2 parents 4d9404d + 96a536a commit f775883
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# 🔧 Fixes

- disable checking whether `qemu_image` value exists (#65)
- config: move action as required argument for debug subcommand only (#71)

# 📖 Documentation

Expand Down
3 changes: 2 additions & 1 deletion kafl_fuzzer/common/config/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def add_args_qemu(parser):
def add_args_debug(parser):
parser.add_argument('--input', metavar='<file/dir>', help='path to input file or workdir.')
parser.add_argument('-n', '--iterations', metavar='<n>', help='execute <n> times (for some actions)')
parser.add_argument('--action', required=False, metavar='<cmd>', help=DEBUG_MODES_HELP)
parser.add_argument('--ptdump-path', required=False, metavar='<file>', help=hidden('path to ptdump executable'))


Expand Down Expand Up @@ -191,6 +190,8 @@ def _add_debug_subcommand(self, parser: _SubParsersAction):

debug_grp = debug_subcommand.add_argument_group("Debug options")
add_args_debug(debug_grp)
# add "action" argument, only for "debug" subcommand
debug_grp.add_argument('--action', required=True, metavar='<cmd>', help=DEBUG_MODES_HELP)

qemu_grp = debug_subcommand.add_argument_group('Qemu/Nyx options')
add_args_qemu(qemu_grp)
Expand Down
1 change: 1 addition & 0 deletions kafl_fuzzer/common/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def cast_expand_path_no_verify(parameter: Any) -> Optional[str]:
Validator("trace", default=False, cast=bool),
Validator("trace_cb", default=False, cast=bool),
# debug
Validator("action"),
Validator("input", default=lambda config, _validator: config.workdir, cast=cast_expand_path_no_verify),
Validator("iterations", cast=int),
Validator("action", is_in=VALID_DEBUG_ACTIONS),
Expand Down

0 comments on commit f775883

Please sign in to comment.