@@ -105,6 +105,47 @@ void cbmc_parse_optionst::eval_verbosity()
105105 ui_message_handler.set_verbosity (v);
106106}
107107
108+ void cbmc_parse_optionst::configure_trace_output ()
109+ {
110+
111+ if (cmdline.isset (" trace-hex" ))
112+ config.trace_config .numeric_representation =
113+ configt::numeric_representationt::HEX;
114+ else
115+ config.trace_config .numeric_representation =
116+ configt::numeric_representationt::BINARY;
117+
118+ if (cmdline.isset (" trace-show-source-code" ))
119+ config.trace_config .show_source_code =true ;
120+ else
121+ config.trace_config .show_source_code =false ;
122+
123+ if (cmdline.isset (" trace-hide-assignments" ))
124+ config.trace_config .show_value_assignments =false ;
125+ else
126+ config.trace_config .show_value_assignments =true ;
127+
128+ if (cmdline.isset (" trace-hide-inputs" ))
129+ config.trace_config .show_inputs =false ;
130+ else
131+ config.trace_config .show_inputs =true ;
132+
133+ if (cmdline.isset (" trace-hide-outputs" ))
134+ config.trace_config .show_outputs =false ;
135+ else
136+ config.trace_config .show_outputs =true ;
137+
138+ if (cmdline.isset (" trace-show-function-calls" ))
139+ config.trace_config .show_function_calls =true ;
140+ else
141+ config.trace_config .show_function_calls =false ;
142+
143+ if (cmdline.isset (" html-trace" ))
144+ config.trace_config .trace_format = configt::trace_formatt::HTML;
145+ else
146+ config.trace_config .trace_format = configt::trace_formatt::STANDARD;
147+ }
148+
108149void cbmc_parse_optionst::get_command_line_options (optionst &options)
109150{
110151 if (config.set (cmdline))
@@ -159,14 +200,7 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
159200 cmdline.isset (" stop-on-fail" ))
160201 {
161202 options.set_option (" trace" , true );
162- if (cmdline.isset (" hex" ))
163- options.set_option (" hex" , true );
164-
165- if (cmdline.isset (" trace-verbosity" ))
166- options.set_option (" trace-verbosity" ,
167- cmdline.get_value (" trace-verbosity" ));
168- else
169- options.set_option (" trace-verbosity" , 1 );
203+ configure_trace_output ();
170204 }
171205
172206 if (cmdline.isset (" localize-faults" ))
@@ -1096,5 +1130,14 @@ void cbmc_parse_optionst::help()
10961130 " --xml-interface bi-directional XML interface\n "
10971131 " --json-ui use JSON-formatted output\n "
10981132 " --verbosity # verbosity level\n "
1133+ " \n "
1134+ " Trace formatting options\n "
1135+ " --trace-show-function-calls show functions calls and returns in trace (default is to hide)\n " // NOLINT(*)
1136+ " --trace-hide-assignments show all assignments in trace (default is to show)\n " // NOLINT(*)
1137+ " --trace-hide-inputs show all inputs in trace (default is to show)\n " // NOLINT(*)
1138+ " --trace-hide-outputs show all outputs in trace (default is to show)\n " // NOLINT(*)
1139+ " --trace-show-source-code show lines of source code (default is to hide)\n " // NOLINT(*)
1140+ " --trace-hex outputs assignments to variables in hex (default is binary)\n " // NOLINT(*)
1141+ " --html-trace outputs trace in html format\n "
10991142 " \n " ;
11001143}
0 commit comments