2014-08-29 Gary Benson <gbenson@redhat.com>
+ * common/errors.h (internal_warning): New declaration.
+ (internal_vwarning): Likewise.
+ * common/errors.c (internal_warning): New function.
+ * utils.h (internal_warning): Don't declare.
+ (internal_vwarning): Likewise.
+ * utils.c (internal_warning): Removed.
+
+2014-08-29 Gary Benson <gbenson@redhat.com>
+
* main.c (captured_main): Use warning during startup.
Prefix startup warning messages with command name.
internal_verror (file, line, fmt, ap);
va_end (ap);
}
+
+/* See common/errors.h. */
+
+void
+internal_warning (const char *file, int line, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ internal_vwarning (file, line, fmt, ap);
+ va_end (ap);
+}
extern void internal_verror (const char *file, int line,
const char *fmt, va_list args)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0);
+
+/* An internal problem was detected, but the requested operation can
+ still proceed. Internal warnings indicate programming errors as
+ opposed to more general issues beyond the application's control.
+ A warning message is constructed using a printf- or vprintf-style
+ argument list. The function "internal_vwarning" must be provided
+ by the client. */
+
+extern void internal_warning (const char *file, int line,
+ const char *fmt, ...)
+ ATTRIBUTE_PRINTF (3, 4);
+
+extern void internal_vwarning (const char *file, int line,
+ const char *fmt, va_list args)
+ ATTRIBUTE_PRINTF (3, 0);
\f
/* Like "error", but the error message is constructed by combining
+2014-08-29 Gary Benson <gbenson@redhat.com>
+
+ * utils.c (internal_vwarning): New function.
+
2014-08-28 Gary Benson <gbenson@redhat.com>
* utils.h (fatal): Remove declaration.
exit (1);
}
+/* Report a problem internal to GDBserver. */
+
+void
+internal_vwarning (const char *file, int line, const char *fmt, va_list args)
+{
+ fprintf (stderr, "\
+%s:%d: A problem internal to " TOOLNAME " has been detected.\n", file, line);
+ vfprintf (stderr, fmt, args);
+ fprintf (stderr, "\n");
+}
+
/* Convert a CORE_ADDR into a HEX string, like %lx.
The result is stored in a circular static buffer, NUMCELLS deep. */
internal_vproblem (&internal_warning_problem, file, line, fmt, ap);
}
-void
-internal_warning (const char *file, int line, const char *string, ...)
-{
- va_list ap;
-
- va_start (ap, string);
- internal_vwarning (file, line, string, ap);
- va_end (ap);
-}
-
static struct internal_problem demangler_warning_problem = {
"demangler-warning", 1, internal_problem_ask, 0, internal_problem_no
};
extern void error_stream (struct ui_file *) ATTRIBUTE_NORETURN;
-extern void internal_vwarning (const char *file, int line,
- const char *, va_list ap)
- ATTRIBUTE_PRINTF (3, 0);
-
-extern void internal_warning (const char *file, int line,
- const char *, ...) ATTRIBUTE_PRINTF (3, 4);
-
extern void demangler_vwarning (const char *file, int line,
const char *, va_list ap)
ATTRIBUTE_PRINTF (3, 0);