Skip to content

Write traces to status() not cout #1003

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/cbmc/bmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,16 @@ void bmct::error_trace()
switch(ui)
{
case ui_message_handlert::uit::PLAIN:
std::cout << "\n" << "Counterexample:" << "\n";
show_goto_trace(std::cout, ns, goto_trace);
status() << "Counterexample:" << eom;
show_goto_trace(status(), ns, goto_trace);
status() << eom;
break;

case ui_message_handlert::uit::XML_UI:
{
xmlt xml;
convert(ns, goto_trace, xml);
std::cout << xml << "\n";
status() << xml << eom;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smowton, although this is fine for PLAIN, for JSON and XML this prints the trace into a STATUS-MESSAGE, which is not intended. Please revert. We can only do this after having refactored the message_streamt to support piping out structured objects.

}
break;

Expand All @@ -103,7 +104,7 @@ void bmct::error_trace()
result["status"]=json_stringt("failed");
jsont &json_trace=result["trace"];
convert(ns, goto_trace, json_trace);
std::cout << ",\n" << json_result;
status() << ",\n" << json_result << eom;
}
break;
}
Expand Down