r14794 is related as well.
Also: remove -Wno-format-zero-length from compile options.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14795
-Wpointer-arith \
-Wstrict-prototypes \
-Wmissing-declarations \
- @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
@FLAG_W_NO_TAUTOLOGICAL_COMPARE@ \
-fno-strict-aliasing \
-fno-builtin
269360 s390x: Fix addressing mode selection for compare-and-swap
333051 mmap of huge pages fails due to incorrect alignment
== 339163
+334802 valgrind does not always explain why a given option is bad
335440 arm64: ld1 (single structure) is not implemented
335713 arm64: unhanded instruction: prfm (immediate)
338731 ppc: Fix testuite build for toolchains not supporting -maltivec
return;
bad:
- VG_(fmsg_bad_option)(opt, "");
+ VG_(fmsg_bad_option)(opt, "Bad argument '%s'\n", optval);
overflow:
VG_(fmsg_bad_option)(opt,
CLG_(stat).bb_retranslations);
VG_(message)(Vg_DebugMsg, "Distinct instrs: %d\n",
CLG_(stat).distinct_instrs);
- VG_(message)(Vg_DebugMsg, "");
VG_(message)(Vg_DebugMsg, "LRU Contxt Misses: %d\n",
CLG_(stat).cxt_lru_misses);
o = VG_(open) (shared_mem, VKI_O_CREAT|VKI_O_RDWR, 0600);
if (sr_isError (o)) {
sr_perror(o, "cannot create shared_mem file %s\n", shared_mem);
- fatal("");
+ fatal("Cannot recover from previous error. Good-bye.");
} else {
shared_mem_fd = sr_Res(o);
}
if (sr_isError(res)) {
sr_perror(res, "error VG_(am_shared_mmap_file_float_valgrind) %s\n",
shared_mem);
- fatal("");
+ fatal("Cannot recover from previous error. Good-bye.");
}
addr_shared = sr_Res (res);
}
VG_(exit)(1);
}
+void VG_(fmsg_unknown_option) ( const HChar* opt)
+{
+ revert_to_stderr();
+ VG_(message) (Vg_FailMsg, "Unknown option: %s\n", opt);
+ VG_(message) (Vg_FailMsg, "Use --help for more information or consult the user manual.\n");
+ VG_(exit)(1);
+}
+
UInt VG_(umsg) ( const HChar* format, ... )
{
UInt count;
else if (VG_(strcmp)(tmp_str, "no") == 0)
VG_(clo_fair_sched) = disable_fair_sched;
else
- VG_(fmsg_bad_option)(arg, "");
-
+ VG_(fmsg_bad_option)(arg,
+ "Bad argument, should be 'yes', 'try' or 'no'\n");
}
else if VG_BOOL_CLO(arg, "--trace-sched", VG_(clo_trace_sched)) {}
else if VG_BOOL_CLO(arg, "--trace-signals", VG_(clo_trace_signals)) {}
else if ( ! VG_(needs).command_line_options
|| ! VG_TDICT_CALL(tool_process_cmd_line_option, arg) ) {
- VG_(fmsg_bad_option)(arg, "");
+ VG_(fmsg_unknown_option)(arg);
}
}
chaos. No big deal; dump_error is a flag for debugging V
itself. */
if (VG_(clo_dump_error) > 0) {
- VG_(fmsg_bad_option)("--xml=yes together with --dump-error", "");
+ VG_(fmsg_bad_option)("--xml=yes",
+ "Cannot be used together with --dump-error");
}
/* Disable error limits (this might be a bad idea!) */
__attribute__((noreturn))
extern void VG_(err_config_error) ( const HChar* format, ... );
+/* Called by main_process_cmd_line_options to indicate an unrecognised
+ command line option. */
+__attribute__((noreturn))
+extern void VG_(fmsg_unknown_option) ( const HChar *opt );
+
#endif // __PUB_CORE_LIBCPRINT_H
/*--------------------------------------------------------------------*/
Long n = VG_(strtoll10)( val, &s ); \
(qq_var) = n; \
/* Check for non-numeralness, or overflow. */ \
- if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, ""); \
+ if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, \
+ "Invalid integer value '%s'\n", val); \
True; \
}) \
)
/* for all the other macros in this file. */ \
/* Check for non-numeralness, or overflow. */ \
/* Nb: it will overflow if qq_var is unsigned and qq_val is negative! */ \
- if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, ""); \
+ if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, \
+ "Invalid integer value '%s'\n", val); \
/* Check bounds. */ \
if ((qq_var) < (qq_lo) || (qq_var) > (qq_hi)) { \
VG_(fmsg_bad_option)(qq_arg, \
double n = VG_(strtod)( val, &s ); \
(qq_var) = n; \
/* Check for non-numeralness */ \
- if ('\0' != s[0]) VG_(fmsg_bad_option)(qq_arg, ""); \
+ if ('\0' != s[0]) VG_(fmsg_bad_option)(qq_arg, \
+ "Invalid floating point value '%s'\n",val); \
True; \
}) \
)
// Check options.
if (clo_pages_as_heap) {
if (clo_stacks) {
- VG_(fmsg_bad_option)(
- "--pages-as-heap=yes together with --stacks=yes", "");
+ VG_(fmsg_bad_option)("--pages-as-heap=yes",
+ "Cannot be used together with --stacks=yes");
}
}
if (!clo_heap) {
-valgrind: Bad option: --bad-bad-option
+valgrind: Unknown option: --bad-bad-option
valgrind: Use --help for more information or consult the user manual.