From: Philippe Waroquiers Date: Fri, 12 Oct 2012 21:46:55 +0000 (+0000) Subject: Some wrong options silently ignored if starting with same letters as valid option X-Git-Tag: svn/VALGRIND_3_9_0~631 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d14e1d1d742e1b7238da35821db856d1ca7f3de;p=thirdparty%2Fvalgrind.git Some wrong options silently ignored if starting with same letters as valid option For example, options below are silently "accepted"+ignored: valgrind --profile-heaps=yes --max-stackframes=35 memcheck/tests/trivialleak valgrind --profile-heaps=oui --max-stackframes=3.141592654 memcheck/tests/trivialleak Also fixed the on-line --help output for option --core-redzone-size git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13037 --- diff --git a/NEWS b/NEWS index 2f8760bfed..81d00314b1 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,7 @@ m = merged into 3_8_BRANCH 306054 [390] s390x: Condition code computation for convert-to-int/logical 307155 [390] filter_gdb should filter out syscall-template.S T_PSEUDO n-i-bz [390] report error for vgdb snapshot requested before execution +n-i-bz [390] Some wrong command line options could be ignored Release 3.8.1 (19 September 2012) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 930ba9c419..5d3e7751f3 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -221,7 +221,7 @@ static void usage_NORETURN ( Bool debug_help ) " --trace-redir=no|yes show redirection details? [no]\n" " --trace-sched=no|yes show thread scheduler details? [no]\n" " --profile-heap=no|yes profile Valgrind's own space use\n" -" --core-redzone= set minimum size of redzones added before/after\n" +" --core-redzone-size= set minimum size of redzones added before/after\n" " heap blocks allocated for Valgrind internal use (in bytes) [4]\n" " --wait-for-gdb=yes|no pause on startup to wait for gdb attach\n" " --sym-offsets=yes|no show syms in form 'name+offset' ? [no]\n" @@ -486,12 +486,12 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd, else if VG_STREQN(20, arg, "--command-line-only=") {} else if VG_STREQ( arg, "--") {} else if VG_STREQ( arg, "-d") {} - else if VG_STREQN(16, arg, "--max-stackframe") {} - else if VG_STREQN(16, arg, "--main-stacksize") {} - else if VG_STREQN(11, arg, "--sim-hints") {} - else if VG_STREQN(14, arg, "--profile-heap") {} - else if VG_STREQN(14, arg, "--core-redzone-size") {} - else if VG_STREQN(14, arg, "--redzone-size") {} + else if VG_STREQN(17, arg, "--max-stackframe=") {} + else if VG_STREQN(17, arg, "--main-stacksize=") {} + else if VG_STREQN(12, arg, "--sim-hints=") {} + else if VG_STREQN(15, arg, "--profile-heap=") {} + else if VG_STREQN(20, arg, "--core-redzone-size=") {} + else if VG_STREQN(15, arg, "--redzone-size=") {} /* Obsolete options. Report an error and exit */ else if VG_STREQN(34, arg, "--vex-iropt-precise-memory-exns=no") { diff --git a/none/tests/cmdline2.stdout.exp b/none/tests/cmdline2.stdout.exp index 3b89c6b384..b513b7a552 100644 --- a/none/tests/cmdline2.stdout.exp +++ b/none/tests/cmdline2.stdout.exp @@ -110,7 +110,7 @@ usage: valgrind [options] prog-and-args --trace-redir=no|yes show redirection details? [no] --trace-sched=no|yes show thread scheduler details? [no] --profile-heap=no|yes profile Valgrind's own space use - --core-redzone= set minimum size of redzones added before/after + --core-redzone-size= set minimum size of redzones added before/after heap blocks allocated for Valgrind internal use (in bytes) [4] --wait-for-gdb=yes|no pause on startup to wait for gdb attach --sym-offsets=yes|no show syms in form 'name+offset' ? [no]