Skip to content

Make verbosity of symtab2gb configurable #7240

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
4 changes: 4 additions & 0 deletions doc/man/symtab2gb.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ This is to support integration of external language frontends, such as Ada
(using GNAT2GOTO: https://github.com/diffblue/gnat2goto) or Rust (using Kani:
https://github.com/model-checking/kani).
.SH OPTIONS
.TP
\fB\-\-out\fR \fIoutfile\fR
Specify the filename of the resulting binary (default: a.out)
.TP
\fB\-\-verbosity\fR #
verbosity level
.SH ENVIRONMENT
All tools honor the TMPDIR environment variable when generating temporary
files and directories.
Expand Down
8 changes: 6 additions & 2 deletions src/symtab2gb/symtab2gb_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ static inline bool failed(bool error_indicator)

static void run_symtab2gb(
const std::vector<std::string> &symtab_filenames,
const std::string &gb_filename)
const std::string &gb_filename,
const std::string &cmdline_verbosity)
{
// try opening all the files first to make sure we can
// even read/write what we want
Expand All @@ -65,6 +66,8 @@ static void run_symtab2gb(
}

stream_message_handlert message_handler{std::cerr};
messaget::eval_verbosity(
cmdline_verbosity, messaget::M_STATISTICS, message_handler);

auto const symtab_language = new_json_symtab_language();
symtab_language->set_message_handler(message_handler);
Expand Down Expand Up @@ -138,7 +141,7 @@ int symtab2gb_parse_optionst::doit()
}
register_languages();
config.set(cmdline);
run_symtab2gb(symtab_filenames, gb_filename);
run_symtab2gb(symtab_filenames, gb_filename, cmdline.get_value("verbosity"));
return CPROVER_EXIT_SUCCESS;
}

Expand All @@ -162,5 +165,6 @@ void symtab2gb_parse_optionst::help()
"--out <outfile> specify the filename of\n"
" the resulting binary\n"
" (default: a.out)\n"
" --verbosity # verbosity level\n"
<< messaget::eom;
}
1 change: 1 addition & 0 deletions src/symtab2gb/symtab2gb_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Author: Diffblue Ltd.

#define SYMTAB2GB_OPTIONS \
"(" SYMTAB2GB_OUT_FILE_OPT "):" \
"(verbosity):" \
// end options

// clang-format on
Expand Down