Skip to content

Commit 9777364

Browse files
Merge pull request diffblue#413 from diffblue/cleanup/sec_driver_options
Cleanup sec driver options
2 parents 076e63b + fbd0f90 commit 9777364

File tree

2 files changed

+39
-73
lines changed

2 files changed

+39
-73
lines changed

src/driver/sec_driver_parse_options.cpp

Lines changed: 37 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
sec_driver_parse_optionst::sec_driver_parse_optionst(int argc, const char **argv):
7373
parse_options_baset(SEC_DRIVER_OPTIONS, argc, argv),
7474
language_uit(cmdline, ui_message_handler),
75-
ui_message_handler(cmdline, "Diffblue Security Analyzer " CBMC_VERSION)
75+
ui_message_handler(cmdline, "Diffblue Security Analyzer " SEC_DRIVER_VERSION)
7676
{
7777
}
7878

@@ -134,11 +134,14 @@ static irep_idt get_cprover_start_main_callee(const goto_modelt &goto_model)
134134
/// invoke main modules
135135
int sec_driver_parse_optionst::doit()
136136
{
137+
// Print a banner
138+
status() << "Diffblue Security Analyzer version " SEC_DRIVER_VERSION " "
139+
<< sizeof(void *) * 8 << "-bit "
140+
<< config.this_architecture() << " "
141+
<< config.this_operating_system() << eom;
142+
137143
if(cmdline.isset("version"))
138-
{
139-
std::cout << CBMC_VERSION << std::endl;
140144
return CPROVER_EXIT_SUCCESS;
141-
}
142145

143146
//
144147
// command line options
@@ -156,14 +159,6 @@ int sec_driver_parse_optionst::doit()
156159
get_command_line_options(options);
157160
eval_verbosity();
158161

159-
//
160-
// Print a banner
161-
//
162-
status() << "Diffblue Security Analyzer version " CBMC_VERSION " "
163-
<< sizeof(void *)*8 << "-bit "
164-
<< config.this_architecture() << " "
165-
<< config.this_operating_system() << eom;
166-
167162
register_languages();
168163
register_evs_pretty_printer();
169164

@@ -536,78 +531,49 @@ bool sec_driver_parse_optionst::process_goto_functions(
536531
/// display command line help
537532
void sec_driver_parse_optionst::help()
538533
{
539-
std::cout <<
540-
"\n"
541-
"* * Diffblue Security Analyzer " CBMC_VERSION " - Copyright (C) 2016 ";
542-
543-
std::cout << "(" << (sizeof(void *)*8) << "-bit version)";
544-
545-
std::cout << " * *\n";
546-
547-
std::cout <<
548-
"* * Daniel Kroening, Diffblue * *\n"
549-
"* * [email protected] * *\n"
550-
"\n"
534+
std::cout
535+
<< "\n Diffblue Security Analyzer " SEC_DRIVER_VERSION " ("
536+
<< (sizeof(void *) * 8) << "-bit version)\n"
537+
" Copyright © 2016–2018\n\n"
551538
"Usage: Purpose:\n"
552539
"\n"
553-
" sec-driver [-h] [--help] show help\n"
554-
" sec-driver file.c ... source file names\n"
540+
" security-analyzer [-h] [--help] show help\n"
541+
" security-analyzer file.class ... source file names\n"
555542
"\n"
556543
"Analyses:\n"
557544
"\n"
558-
" --security-scanner file_name perform taint analysis using configuration "
559-
" in given JSON file\n"
560-
" --unreachable-instructions list dead code\n"
561-
" --intervals interval analysis\n"
562-
" --non-null non-null analysis\n"
545+
" --security-scanner config.json perform taint analysis using configuration\n"
546+
" in given JSON file\n"
547+
" --local-value-set-analysis perform local value set analysis only\n"
548+
" --unreachable-instructions list dead code\n"
549+
" --intervals interval analysis\n"
550+
" --non-null non-null analysis\n"
563551
"\n"
564552
"Analysis options:\n"
565-
" --json file_name output results in JSON format to given file\n"
566-
" --xml file_name output results in XML format to given file\n"
567-
" --function set main function name\n"
568-
"\n"
569-
"C/C++ frontend options:\n"
570-
" -I path set include path (C/C++)\n"
571-
" -D macro define preprocessor macro (C/C++)\n"
572-
" --arch X set architecture (default: "
573-
<< configt::this_architecture() << ")\n"
574-
" --os set operating system (default: "
575-
<< configt::this_operating_system() << ")\n"
576-
" --c89/99/11 set C language standard (default: "
577-
<< (configt::ansi_ct::default_c_standard()==
578-
configt::ansi_ct::c_standardt::C89?"c89":
579-
configt::ansi_ct::default_c_standard()==
580-
configt::ansi_ct::c_standardt::C99?"c99":
581-
configt::ansi_ct::default_c_standard()==
582-
configt::ansi_ct::c_standardt::C11?"c11":"") << ")\n"
583-
" --cpp98/03/11 set C++ language standard (default: "
584-
<< (configt::cppt::default_cpp_standard()==
585-
configt::cppt::cpp_standardt::CPP98?"cpp98":
586-
configt::cppt::default_cpp_standard()==
587-
configt::cppt::cpp_standardt::CPP03?"cpp03":
588-
configt::cppt::default_cpp_standard()==
589-
configt::cppt::cpp_standardt::CPP11?"cpp11":"") << ")\n"
590-
#ifdef _WIN32
591-
" --gcc use GCC as preprocessor\n"
592-
#endif
593-
" --no-library disable built-in abstract C library\n"
553+
" --json file_name output results in JSON format to given file\n"
554+
" --xml file_name output results in XML format to given file\n"
555+
" --function set main function name\n"
556+
" --lvsa-function set function to analyze with LVSA\n"
557+
" --lvsa-summary-directory directory to store LVSA summaries\n"
594558
"\n"
595559
"Java Bytecode frontend options:\n"
596-
" --classpath dir/jar set the classpath\n"
597-
" --main-class class-name set the name of the main class\n"
560+
" --classpath dir/jar set the classpath\n"
561+
" --main-class class-name set the name of the main class\n"
598562
JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP
599563
"\n"
600564
"Program representations:\n"
601-
" --show-parse-tree show parse tree\n"
602-
" --show-symbol-table show symbol table\n"
603-
" --show-goto-functions show goto program\n"
604-
" --show-properties show the properties, but don't run analysis\n"
605-
" --dump-html-program dump goto program in HTML format into\n"
606-
" a directory. Pass a non existing directory\n"
607-
" path-name with this option. The directory\n"
608-
" will be created with the dumped program.\n"
565+
" --show-parse-tree show parse tree\n"
566+
" --show-symbol-table show symbol table\n"
567+
" --show-goto-functions show goto program\n"
568+
" --show-properties show the properties, but don't run analysis\n"
569+
" --show-value-sets show value set for entry point\n"
570+
" --show-value-sets-all show all value sets\n"
571+
" --dump-html-program dump goto program in HTML format into\n"
572+
" a directory. Pass a non existing directory\n"
573+
" path-name with this option. The directory\n"
574+
" will be created with the dumped program.\n"
609575
"\n"
610576
"Other options:\n"
611-
" --version show version and exit\n"
577+
" --version show version and exit\n"
612578
"\n";
613579
}

src/driver/sec_driver_parse_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
class bmct;
2121
class optionst;
2222

23+
#define SEC_DRIVER_VERSION "0.1"
24+
2325
#define SEC_DRIVER_OPTIONS \
2426
"(function):" \
25-
"D:I:(std89)(std99)(std11)" \
2627
"(classpath):(cp):(main-class):" \
2728
"(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
2829
"(little-endian)(big-endian)" \
@@ -31,7 +32,6 @@ class optionst;
3132
"(dump-html-program):" \
3233
"(show-properties)(show-reachable-properties)(property):" \
3334
"(verbosity):(version)" \
34-
"(gcc)(arch):" \
3535
"(taint):(show-taint)" \
3636
"(taint-use-summaries):" \
3737
"(show-local-may-alias)" \

0 commit comments

Comments
 (0)