-
Notifications
You must be signed in to change notification settings - Fork 277
Remove DEBUG ifdefs which broke the debug build #647
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
Conversation
Could you also add the build to the travis build as part of this PR:
|
c304ef7
to
fbdf29a
Compare
There's more stuff that is broken: https://travis-ci.org/diffblue/cbmc/jobs/211814527#L274 |
d8c2558
to
1fbda78
Compare
1fbda78
to
6c53036
Compare
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.
Thanks a lot for this cleanup, and indeed we should be build-testing various #ifdef options. Several debug messages seemed rather useful - I'd ask to fix them rather than removing them.
src/analyses/natural_loops.h
Outdated
#ifdef DEBUG | ||
cfg_dominators.output(std::cout); | ||
#endif | ||
|
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.
This should be fixed rather than removed.
src/cpp/parse.cpp
Outdated
std::cout << std::string(__indent, ' ') << "Parser::rDefinition 1 " << t | ||
<< "\n"; | ||
#endif | ||
|
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.
Please fix rather than remove.
src/cpp/parse.cpp
Outdated
std::cout << std::string(__indent, ' ') << "TEMPLATE_TYPE: " | ||
<< template_type << std::endl; | ||
#endif | ||
|
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.
Please fix rather than remove.
src/cpp/parse.cpp
Outdated
<< "Parser::rIntegralDeclaration 8 " | ||
<< declaration << "\n"; | ||
#endif | ||
|
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.
Please fix rather than remove.
src/cpp/parse.cpp
Outdated
std::cout << std::string(__indent, ' ') << "Parser::rClassBody " << member | ||
<< std::endl; | ||
#endif | ||
|
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.
Please fix rather than remove.
#ifdef DEBUG | ||
cout << "Finished symex, invoking decision procedure." << endl; | ||
#endif | ||
|
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.
Please fix rather than remove.
@@ -76,9 +74,6 @@ void trace_automatont::add_path(patht &path) | |||
for(const auto &step : path) | |||
{ | |||
goto_programt::targett l=step.loc; | |||
#ifdef DEBUG | |||
std::cout << ", " << l->location_number << ":" << l->location; | |||
#endif |
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.
Please fix rather than remove.
<< " accept states and " << nta.count_transitions() | ||
<< " transitions" << endl; | ||
#endif | ||
|
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.
Please fix rather than remove.
#ifdef DEBUG | ||
std::cout << "There are " << init_states.size() << " init states" << endl; | ||
#endif | ||
|
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.
Please fix rather than remove.
<< merge_into.var.start_pc + merge_into.var.length | ||
<< messaget::eom; | ||
#endif | ||
|
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.
Please fix rather than remove.
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.
Thanks a lot for looking at the problems in more detail - I've added a few hints on how to re-add some of the objects to be printed. This should then be ready to go after some merging of commits.
src/cpp/parse.cpp
Outdated
std::cout << std::string(__indent, ' ') << "TEMPLATE_TYPE: " | ||
<< template_type << std::endl; | ||
std::cout << std::string(__indent, ' ') << "BODY\n"; | ||
std::cout << std::string(__indent, ' ') << "TEMPLATE_TYPE\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.
It seems body
and template_type
have been dropped here - I think you'll need body.pretty()
and template_type.pretty()
src/cpp/parse.cpp
Outdated
@@ -1911,10 +1907,8 @@ bool Parser::rIntegralDeclaration( | |||
{ | |||
#ifdef DEBUG | |||
std::cout << std::string(__indent, ' ') | |||
<< "Parser::rIntegralDeclaration 8 " | |||
<< declaration << "\n"; | |||
<< "Parser::rIntegralDeclaration 8\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.
I think declaration.pretty()
should be re-added here.
src/cpp/parse.cpp
Outdated
#ifdef DEBUG | ||
std::cout << std::string(__indent, ' ') << "Parser::rClassBody " << member | ||
<< std::endl; | ||
std::cout << std::string(__indent, ' ') << "Parser::rClassBody\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.
member.pretty()
appears to be missing here.
src/cpp/parse.cpp
Outdated
@@ -9245,8 +9237,7 @@ bool Parser::rExprStatement(codet &statement) | |||
if(rDeclarationStatement(statement)) | |||
{ | |||
#ifdef DEBUG | |||
std::cout << std::string(__indent, ' ') << "rDe: " << statement | |||
<< std::endl; | |||
std::cout << std::string(__indent, ' ') << "rDe\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.
statement.pretty()
#ifdef DEBUG | ||
std::cout << ", " << l->location_number << ":" << l->location; | ||
std::cout << ", " << l->location_number; |
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.
Could you please add << ':' << l->location.as_string()
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.
This seems good to go save for squashing of commits (IMHO).
9c10e5c
to
1a5c69d
Compare
With this commit applied, the build succeeds when invoked by
make CXXFLAGS=-DDEBUG
. This is achieved by deleting anything within a#ifdef DEBUG
block which caused build errors. Several files also contained// #define DEBUG
lines, which have been removed.