Skip to content

Commit

Permalink
Split binary string in plain-text output of goto trace in groups of 8
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 4, 2018
1 parent 0ff1384 commit 6f72d9b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/goto-programs/goto_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,18 @@ std::string trace_value_binary(
type.id()==ID_c_enum ||
type.id()==ID_c_enum_tag)
{
return expr.get_string(ID_value);
const std::string & str = expr.get_string(ID_value);

std::ostringstream oss;
std::string::size_type i = 0;
for(const auto c : str)
{
oss << c;
if(++i % 8 == 0 && str.size() != i)
oss << ' ';
}

return oss.str();
}
else if(type.id()==ID_bool)
{
Expand Down

0 comments on commit 6f72d9b

Please sign in to comment.