-
Notifications
You must be signed in to change notification settings - Fork 273
Trace output configuration options #1565
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 12 commits
18a45e3
686fedd
6725c8c
24a4875
7a1dca7
cb560d3
d88d5d6
c05ab18
671db6b
51bfbd7
5129907
94391c1
9b8cbfb
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 |
---|---|---|
|
@@ -102,6 +102,36 @@ void cbmc_parse_optionst::eval_verbosity() | |
ui_message_handler.set_verbosity(v); | ||
} | ||
|
||
void cbmc_parse_optionst::configure_trace_output() | ||
{ | ||
if(cmdline.isset("trace-hex")) | ||
config.trace_config.numeric_representation = | ||
configt::numeric_representationt::HEX; | ||
else | ||
config.trace_config.numeric_representation = | ||
configt::numeric_representationt::BINARY; | ||
|
||
config.trace_config.show_source_code = | ||
cmdline.isset("trace-show-source-code"); | ||
|
||
config.trace_config.show_value_assignments = | ||
!cmdline.isset("trace-hide-assignments"); | ||
|
||
config.trace_config.show_inputs = | ||
!cmdline.isset("trace-hide-inputs"); | ||
|
||
config.trace_config.show_outputs = | ||
!cmdline.isset("trace-hide-ouputs"); | ||
|
||
config.trace_config.show_function_calls = | ||
cmdline.isset("trace-show-function-calls"); | ||
|
||
if(cmdline.isset("trace-html")) | ||
config.trace_config.trace_format = configt::trace_formatt::HTML; | ||
else | ||
config.trace_config.trace_format = configt::trace_formatt::STANDARD; | ||
} | ||
|
||
void cbmc_parse_optionst::get_command_line_options(optionst &options) | ||
{ | ||
if(config.set(cmdline)) | ||
|
@@ -154,7 +184,10 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options) | |
|
||
if(cmdline.isset("trace") || | ||
cmdline.isset("stop-on-fail")) | ||
{ | ||
options.set_option("trace", true); | ||
configure_trace_output(); | ||
} | ||
|
||
if(cmdline.isset("localize-faults")) | ||
options.set_option("localize-faults", true); | ||
|
@@ -1024,5 +1057,14 @@ void cbmc_parse_optionst::help() | |
" --xml-interface bi-directional XML interface\n" | ||
" --json-ui use JSON-formatted output\n" | ||
" --verbosity # verbosity level\n" | ||
"\n" | ||
"Trace formatting options\n" | ||
"--trace-show-function-calls show functions calls and returns in trace (default is to hide)\n" // NOLINT(*) | ||
"--trace-hide-assignments hide all assignments in trace (default is to show)\n" // NOLINT(*) | ||
"--trace-hide-inputs hide all inputs in trace (default is to show)\n" // NOLINT(*) | ||
"--trace-hide-outputs hide all outputs in trace (default is to show)\n" // NOLINT(*) | ||
"--trace-show-source-code show lines of source code (default is to hide)\n" // NOLINT(*) | ||
"--trace-hex outputs assignments to variables in hex (default is binary)\n" // NOLINT(*) | ||
"--trace-html outputs trace in html format\n" | ||
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. What is the result of using 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. json overrides. I don't know what the expected result should be, but the json trace doesn't use any of my new configuration options |
||
"\n"; | ||
} |
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.
Using
config
for this kind of settings is uncommon. Use options.