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