gdb/common/errors.h - gdb

Macros defined

Source code

  1. /* Declarations for error-reporting facilities.

  2.    Copyright (C) 1986-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef COMMON_ERRORS_H
  15. #define COMMON_ERRORS_H

  16. /* A problem was detected, but the requested operation can still
  17.    proceedA warning message is constructed using a printf- or
  18.    vprintf-style argument list.  The function "vwarning" must be
  19.    provided by the client.  */

  20. extern void warning (const char *fmt, ...)
  21.      ATTRIBUTE_PRINTF (1, 2);

  22. extern void vwarning (const char *fmt, va_list args)
  23.      ATTRIBUTE_PRINTF (1, 0);

  24. /* A non-predictable, non-fatal error was detected.  The requested
  25.    operation cannot proceed.  An error message is constructed using
  26.    a printf- or vprintf-style argument list.  These functions do not
  27.    return.  The function "verror" must be provided by the client.  */

  28. extern void error (const char *fmt, ...)
  29.      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);

  30. extern void verror (const char *fmt, va_list args)
  31.      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);

  32. /* An internal error was detected.  Internal errors indicate
  33.    programming errors such as assertion failures, as opposed to
  34.    more general errors beyond the application's control.  These
  35.    functions do not return.  An error message is constructed using
  36.    a printf- or vprintf-style argument list.  FILE and LINE
  37.    indicate the file and line number where the programming error
  38.    was detected.  The function "internal_verror" must be provided
  39.    by the client.  */

  40. extern void internal_error (const char *file, int line,
  41.                             const char *fmt, ...)
  42.      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);

  43. extern void internal_verror (const char *file, int line,
  44.                              const char *fmt, va_list args)
  45.      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0);

  46. /* An internal problem was detected, but the requested operation can
  47.    still proceed.  Internal warnings indicate programming errors as
  48.    opposed to more general issues beyond the application's control.
  49.    A warning message is constructed using a printf- or vprintf-style
  50.    argument list.  The function "internal_vwarning" must be provided
  51.    by the client.  */

  52. extern void internal_warning (const char *file, int line,
  53.                               const char *fmt, ...)
  54.      ATTRIBUTE_PRINTF (3, 4);

  55. extern void internal_vwarning (const char *file, int line,
  56.                                const char *fmt, va_list args)
  57.      ATTRIBUTE_PRINTF (3, 0);


  58. /* Like "error", but the error message is constructed by combining
  59.    STRING with the system error message for errno.  This function does
  60.    not return.  This function must be provided by the client.  */

  61. extern void perror_with_name (const char *string) ATTRIBUTE_NORETURN;

  62. /* Call this function to handle memory allocation failures.  This
  63.    function does not return.  This function must be provided by the
  64.    client.  */

  65. extern void malloc_failure (long size) ATTRIBUTE_NORETURN;

  66. #endif /* COMMON_ERRORS_H */