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