vtv_fail.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (C) 2012-2022 Free Software Foundation, Inc.
  2. //
  3. // This file is part of GCC.
  4. //
  5. // GCC is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // GCC is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. #ifndef _VTV_FAIL_H
  21. #define _VTV_FAIL_H 1
  22. /* __vtv_really_fail prints a backtrace and a memory dump, then calls
  23. abort. It is here for programmers to call, presumably from
  24. __vtv_verify_fail, if they choose to overwrite the standard
  25. __vtv_verify_fail with one of their own. Programmers should NOT
  26. attempt to rewrite __vtv_really_fail. */
  27. extern void
  28. __vtv_really_fail (const char *fail_msg)
  29. __attribute__ ((visibility ("default"), noreturn, nothrow));
  30. /* __vtv_verify_fail is the function that gets called if the vtable
  31. verification code discovers a vtable pointer that it cannot verify
  32. as valid. Normally __vtv_verify_fail calls __vtv_really_fail.
  33. However programmers can write and link in their own version of
  34. __vtv_verify_fail, if they wish to do some kind of secondary
  35. verification, for example. The main verification code assumes that
  36. IF __vtv_verify_fail returns, then some kind of secondary
  37. verification was done AND that the secondary verification succeeded,
  38. i.e. that the vtable pointer is actually valid and ok to use. If
  39. the secondary verification fails, then __vtv_verify_fail should not
  40. return. */
  41. extern void
  42. __vtv_verify_fail (void **data_set_ptr, const void *vtbl_pointer)
  43. __attribute__((visibility ("default"), nothrow));
  44. extern void
  45. __vtv_verify_fail_debug (void **data_set_ptr, const void *vtbl_pointer,
  46. const char *debug_msg)
  47. __attribute__((visibility ("default"), nothrow));
  48. #endif /* _VTV_FAIL_H */