Skip to content

Change class loading and parsing warnings to debug messages. #5224

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
Merged
Show file tree
Hide file tree
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
24 changes: 12 additions & 12 deletions jbmc/src/java_bytecode/java_bytecode_convert_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ void java_bytecode_convert_classt::convert(
}
catch(const unsupported_java_class_signature_exceptiont &e)
{
warning() << "Class: " << c.name
<< "\n could not parse signature: " << c.signature.value()
<< "\n " << e.what() << "\n ignoring that the class is generic"
<< eom;
debug() << "Class: " << c.name
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the verbosity level for debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's like this
1 - error
2 - warning
4 - result
6 - status
8 - stats
10 - debug

<< "\n could not parse signature: " << c.signature.value()
<< "\n " << e.what() << "\n ignoring that the class is generic"
<< eom;
}
}

Expand Down Expand Up @@ -364,10 +364,10 @@ void java_bytecode_convert_classt::convert(
}
catch(const unsupported_java_class_signature_exceptiont &e)
{
warning() << "Superclass: " << c.super_class << " of class: " << c.name
<< "\n could not parse signature: " << superclass_ref.value()
<< "\n " << e.what()
<< "\n ignoring that the superclass is generic" << eom;
debug() << "Superclass: " << c.super_class << " of class: " << c.name
<< "\n could not parse signature: " << superclass_ref.value()
<< "\n " << e.what()
<< "\n ignoring that the superclass is generic" << eom;
class_type.add_base(base);
}
}
Expand Down Expand Up @@ -404,10 +404,10 @@ void java_bytecode_convert_classt::convert(
}
catch(const unsupported_java_class_signature_exceptiont &e)
{
warning() << "Interface: " << interface << " of class: " << c.name
<< "\n could not parse signature: " << interface_ref.value()
<< "\n " << e.what()
<< "\n ignoring that the interface is generic" << eom;
debug() << "Interface: " << interface << " of class: " << c.name
<< "\n could not parse signature: " << interface_ref.value()
<< "\n " << e.what()
<< "\n ignoring that the interface is generic" << eom;
class_type.add_base(base);
}
}
Expand Down
22 changes: 11 additions & 11 deletions jbmc/src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,21 @@ java_method_typet member_type_lazy(
}
else
{
message.warning() << "Method: " << class_name << "." << method_name
<< "\n signature: " << signature.value()
<< "\n descriptor: " << descriptor
<< "\n different number of parameters, reverting to "
"descriptor"
<< message.eom;
message.debug() << "Method: " << class_name << "." << method_name
<< "\n signature: " << signature.value()
<< "\n descriptor: " << descriptor
<< "\n different number of parameters, reverting to "
"descriptor"
<< message.eom;
}
}
catch(const unsupported_java_class_signature_exceptiont &e)
{
message.warning() << "Method: " << class_name << "." << method_name
<< "\n could not parse signature: " << signature.value()
<< "\n " << e.what() << "\n"
<< " reverting to descriptor: " << descriptor
<< message.eom;
message.debug() << "Method: " << class_name << "." << method_name
<< "\n could not parse signature: " << signature.value()
<< "\n " << e.what() << "\n"
<< " reverting to descriptor: " << descriptor
<< message.eom;
}
}
return to_java_method_type(*member_type_from_descriptor);
Expand Down
16 changes: 7 additions & 9 deletions jbmc/src/java_bytecode/java_class_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ java_class_loadert::get_parse_tree(
++parse_tree_it;
break;
}
warning()
<< "Skipping class " << class_name
<< " marked with OverlayClassImplementation but found before"
" original definition"
<< eom;
debug() << "Skipping class " << class_name
<< " marked with OverlayClassImplementation but found before"
" original definition"
<< eom;
}
auto unloaded_or_overlay_out_of_order_it = parse_tree_it;
++parse_tree_it;
Expand All @@ -180,9 +179,8 @@ java_class_loadert::get_parse_tree(
// Remove non-initial classes that aren't overlays
if(!is_overlay_class(parse_tree_it->parsed_class))
{
warning()
<< "Skipping duplicate definition of class " << class_name
<< " not marked with OverlayClassImplementation" << eom;
debug() << "Skipping duplicate definition of class " << class_name
<< " not marked with OverlayClassImplementation" << eom;
auto duplicate_non_overlay_it = parse_tree_it;
++parse_tree_it;
parse_trees.erase(duplicate_non_overlay_it);
Expand All @@ -194,7 +192,7 @@ java_class_loadert::get_parse_tree(
return parse_trees;

// Not found or failed to load
warning() << "failed to load class " << class_name << eom;
debug() << "failed to load class " << class_name << eom;
parse_trees.emplace_back(class_name);
return parse_trees;
}
Expand Down