Skip to content

Commit 6643eb4

Browse files
Petr BauchPetr Bauch
Petr Bauch
authored and
Petr Bauch
committed
Simply handling the options
We only store the strings here.
1 parent 1d2e01c commit 6643eb4

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

src/goto-harness/memory_snapshot_harness_generator.cpp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,18 @@ void memory_snapshot_harness_generatort::handle_option(
3636
{
3737
memory_snapshot_file = require_exactly_one_value(option, values);
3838
}
39-
else if(option == "initial-location")
39+
else if(option == "initial-goto-location")
4040
{
41-
const std::string initial_location =
42-
require_exactly_one_value(option, values);
43-
44-
std::vector<std::string> start;
45-
split_string(initial_location, ':', start, true);
46-
47-
if(
48-
start.empty() || start.front().empty() ||
49-
(start.size() == 2 && start.back().empty()) || start.size() > 2)
50-
{
51-
throw invalid_command_line_argument_exceptiont(
52-
"invalid initial location specification", "--initial-location");
53-
}
54-
55-
entry_function_name = start.front();
56-
57-
if(start.size() == 2)
58-
{
59-
location_number = optionalt<unsigned>(safe_string2unsigned(start.back()));
60-
}
41+
initial_goto_location_line = require_exactly_one_value(option, values);
6142
}
6243
else if(option == "havoc-variables")
6344
{
6445
variables_to_havoc.insert(values.begin(), values.end());
6546
}
47+
else if(option == "initial-source-location")
48+
{
49+
initial_source_location_line = require_exactly_one_value(option, values);
50+
}
6651
else
6752
{
6853
throw invalid_command_line_argument_exceptiont(

src/goto-harness/memory_snapshot_harness_generator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ class memory_snapshot_harness_generatort : public goto_harness_generatort
246246
goto_modelt &goto_model,
247247
const symbolt &function) const;
248248

249+
/// data to store the command-line options
249250
std::string memory_snapshot_file;
250-
251-
irep_idt entry_function_name;
252-
optionalt<unsigned> location_number;
251+
std::string initial_goto_location_line;
252+
std::string initial_source_location_line;
253253
std::unordered_set<irep_idt> variables_to_havoc;
254254

255255
/// data to initialize the entry function

0 commit comments

Comments
 (0)