Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
if VG_STREQ(val, "yes") (qq_var) = True; \
else if VG_STREQ(val, "no") (qq_var) = False; \
+ else VG_(fmsg_bad_option)(qq_arg, "Invalid boolean value '%s'" \
+ " (should be 'yes' or 'no')\n", val); \
True; \
}) \
)
Long n = VG_(strtoll10)( val, &s ); \
(qq_var) = n; \
/* Check for non-numeralness, or overflow. */ \
- if ('\0' != s[0] || (qq_var) != n) VG_(err_bad_option)(qq_arg); \
+ if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, ""); \
True; \
}) \
)
Char* s; \
Long n = VG_(strtoll##qq_base)( val, &s ); \
(qq_var) = n; \
+ /* MMM: separate the two cases, and explain the problem; likewise */ \
+ /* 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_(err_bad_option)(qq_arg); \
+ if ('\0' != s[0] || (qq_var) != n) VG_(fmsg_bad_option)(qq_arg, ""); \
/* Check bounds. */ \
if ((qq_var) < (qq_lo) || (qq_var) > (qq_hi)) { \
- VG_(message)(Vg_UserMsg, \
- "'%s' argument must be between %lld and %lld\n", \
- (qq_option), (Long)(qq_lo), (Long)(qq_hi)); \
- VG_(err_bad_option)(qq_arg); \
+ VG_(fmsg_bad_option)(qq_arg, \
+ "'%s' argument must be between %lld and %lld\n", \
+ (qq_option), (Long)(qq_lo), (Long)(qq_hi)); \
} \
True; \
}) \
double n = VG_(strtod)( val, &s ); \
(qq_var) = n; \
/* Check for non-numeralness */ \
- if ('\0' != s[0]) VG_(err_bad_option)(qq_arg); \
+ if ('\0' != s[0]) VG_(fmsg_bad_option)(qq_arg, ""); \
True; \
}) \
)
/* Show tool and core statistics */
extern Bool VG_(clo_stats);
+/* wait for vgdb/gdb after reporting that amount of error.
+ Note that this is the initial value provided from the command line.
+ The real value is maintained in VG_(dyn_vgdb_error) and
+ can be changed dynamically.*/
+extern Int VG_(clo_vgdb_error);
+
/* Emit all messages as XML? default: NO */
/* If clo_xml is set, various other options are set in a non-default
way. See vg_main.c and mc_main.c. */
extern Bool VG_(clo_show_below_main);
-/* Call this if a recognised option was bad for some reason. Note:
- don't use it just because an option was unrecognised -- return
- 'False' from VG_(tdict).tool_process_cmd_line_option) to indicate that --
- use it if eg. an option was given an inappropriate argument.
- This function prints an error message, then shuts down the entire system.
- It returns a Bool so it can be used in the _CLO_ macros. */
-__attribute__((noreturn))
-extern void VG_(err_bad_option) ( Char* opt );
-
/* Used to expand file names. "option_name" is the option name, eg.
"--log-file". 'format' is what follows, eg. "cachegrind.out.%p". In
'format':