This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 01/15 v3] Introduce common/errors.h
- From: Gary Benson <gbenson at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>, Tom Tromey <tromey at redhat dot com>
- Date: Fri, 18 Jul 2014 11:44:47 +0100
- Subject: Re: [PATCH 01/15 v3] Introduce common/errors.h
- Authentication-results: sourceware.org; auth=none
- References: <1405520243-17282-1-git-send-email-gbenson at redhat dot com> <1405520243-17282-2-git-send-email-gbenson at redhat dot com> <CADPb22TEuAHAsNg7L6h8We6hJKv0Wdj6vQL6yBbqGcUwRUYpkw at mail dot gmail dot com> <20140717134728 dot GB31916 at blade dot nx> <53C7E6AB dot 4080703 at redhat dot com> <20140717153957 dot GA1921 at blade dot nx> <53C7F5D6 dot 6060102 at redhat dot com> <20140718090630 dot GA17917 at blade dot nx> <CADPb22QMUz7XqD63_Xhr5qEXFqx+=H-2BqnfQGV_VFV==Ta3uA at mail dot gmail dot com>
Doug Evans wrote:
> On Fri, Jul 18, 2014 at 10:06 AM, Gary Benson <gbenson@redhat.com> wrote:
> > [...]
> > /* Throw a fatal error, constructing the message using a printf-style
> > format string and a printf- or vprintf-style argument list. This
> > function does not return. The application will exit. */
> >
> > extern void fatal (const char *fmt, ...)
> > ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
> >
> > extern void vfatal (const char *fmt, va_list args)
> > ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
> > [...]
>
> Remember gdb doesn't exit on fatal().
> fatal() in gdb is essentially ^c (quit() calls fatal()!).
>
> Can I repeat my request to please document this in the function
> comment.
I wanted to avoid putting implementation details here, but I see this
isn't going to happen. Is the attached ok?
Cheers,
Gary
--
/* Display a warning message to the user. The message is constructed
using a printf-style format string and a printf- or vprintf-style
argument list. */
extern void warning (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
extern void vwarning (const char *fmt, va_list args)
ATTRIBUTE_PRINTF (1, 0);
/* Throw a generic error, constructing the message using a printf-
style format string and a printf- or vprintf-style argument list.
This function does not return. */
extern void error (const char *fmt, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
extern void verror (const char *fmt, va_list args)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
/* Throw a generic error, constructing the message by combining STRING
with the system error message for errno. This function does not
return. */
extern void perror_with_name (const char *string) ATTRIBUTE_NORETURN;
/* Throw a fatal error, constructing the message using a printf-style
format string and a printf- or vprintf-style argument list. This
function does not return. Fatal errors cause GDB to return to the
command level. Fatal errors cause gdbserver to exit. */
extern void fatal (const char *fmt, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
extern void vfatal (const char *fmt, va_list args)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
/* Throw an internal error, constructing the message using a printf-
style format string and a printf- or vprintf-style argument list.
This function does not return. */
extern void internal_error (const char *file, int line,
const char *fmt, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);
extern void internal_verror (const char *file, int line,
const char *fmt, va_list args)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0);
/* A special case of internal error used to handle memory allocation
failures. */
extern void malloc_failure (long size) ATTRIBUTE_NORETURN;