Commit | Line | Data |
---|---|---|
54cfded0 | 1 | /* dw2gencfi.h - Support for generating Dwarf2 CFI information. |
b90efa5b | 2 | Copyright (C) 2003-2015 Free Software Foundation, Inc. |
54cfded0 AM |
3 | Contributed by Michal Ludvig <mludvig@suse.cz> |
4 | ||
5 | This file is part of GAS, the GNU Assembler. | |
6 | ||
7 | GAS is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
54cfded0 AM |
10 | any later version. |
11 | ||
12 | GAS is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
19 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
20 | 02110-1301, USA. */ | |
54cfded0 AM |
21 | |
22 | #ifndef DW2GENCFI_H | |
23 | #define DW2GENCFI_H | |
24 | ||
fa8f86ff | 25 | #include "dwarf2.h" |
54cfded0 | 26 | |
a4447b93 | 27 | struct symbol; |
54cfded0 AM |
28 | |
29 | extern const pseudo_typeS cfi_pseudo_table[]; | |
30 | ||
54cfded0 AM |
31 | /* cfi_finish() is called at the end of file. It will complain if |
32 | the last CFI wasn't properly closed by .cfi_endproc. */ | |
a4447b93 RH |
33 | extern void cfi_finish (void); |
34 | ||
35 | /* Entry points for backends to add unwind information. */ | |
36 | extern void cfi_new_fde (struct symbol *); | |
37 | extern void cfi_end_fde (struct symbol *); | |
38 | extern void cfi_set_return_column (unsigned); | |
39 | extern void cfi_add_advance_loc (struct symbol *); | |
69602580 | 40 | extern void cfi_add_label (const char *); |
2be24b54 | 41 | |
a4447b93 RH |
42 | extern void cfi_add_CFA_offset (unsigned, offsetT); |
43 | extern void cfi_add_CFA_def_cfa (unsigned, offsetT); | |
44 | extern void cfi_add_CFA_register (unsigned, unsigned); | |
45 | extern void cfi_add_CFA_def_cfa_register (unsigned); | |
46 | extern void cfi_add_CFA_def_cfa_offset (offsetT); | |
2be24b54 ML |
47 | extern void cfi_add_CFA_restore (unsigned); |
48 | extern void cfi_add_CFA_undefined (unsigned); | |
49 | extern void cfi_add_CFA_same_value (unsigned); | |
50 | extern void cfi_add_CFA_remember_state (void); | |
51 | extern void cfi_add_CFA_restore_state (void); | |
54cfded0 | 52 | |
1bce6bd8 PB |
53 | /* Structures for md_cfi_end. */ |
54 | ||
55 | #if defined (TE_PE) || defined (TE_PEP) | |
56 | #define SUPPORT_FRAME_LINKONCE 1 | |
57 | #else | |
58 | #define SUPPORT_FRAME_LINKONCE 0 | |
59 | #endif | |
60 | ||
61 | struct cfi_insn_data | |
62 | { | |
63 | struct cfi_insn_data *next; | |
64 | #if SUPPORT_FRAME_LINKONCE | |
65 | segT cur_seg; | |
66 | #endif | |
67 | int insn; | |
68 | union | |
69 | { | |
70 | struct | |
71 | { | |
72 | unsigned reg; | |
73 | offsetT offset; | |
74 | } ri; | |
75 | ||
76 | struct | |
77 | { | |
78 | unsigned reg1; | |
79 | unsigned reg2; | |
80 | } rr; | |
81 | ||
82 | unsigned r; | |
83 | offsetT i; | |
84 | ||
85 | struct | |
86 | { | |
87 | symbolS *lab1; | |
88 | symbolS *lab2; | |
89 | } ll; | |
90 | ||
91 | struct cfi_escape_data *esc; | |
92 | ||
93 | struct | |
94 | { | |
95 | unsigned reg, encoding; | |
96 | expressionS exp; | |
97 | } ea; | |
69602580 JB |
98 | |
99 | const char *sym_name; | |
1bce6bd8 PB |
100 | } u; |
101 | }; | |
102 | ||
103 | struct fde_entry | |
104 | { | |
105 | struct fde_entry *next; | |
106 | #if SUPPORT_FRAME_LINKONCE | |
107 | segT cur_seg; | |
108 | #endif | |
109 | symbolS *start_address; | |
110 | symbolS *end_address; | |
111 | struct cfi_insn_data *data; | |
112 | struct cfi_insn_data **last; | |
113 | unsigned char per_encoding; | |
114 | unsigned char lsda_encoding; | |
115 | expressionS personality; | |
116 | expressionS lsda; | |
117 | unsigned int return_column; | |
118 | unsigned int signal_frame; | |
119 | #if SUPPORT_FRAME_LINKONCE | |
120 | int handled; | |
121 | #endif | |
122 | }; | |
123 | ||
af385746 RH |
124 | /* The list of all FDEs that have been collected. */ |
125 | extern struct fde_entry *all_fde_data; | |
126 | ||
1bce6bd8 PB |
127 | /* Fake CFI type; outside the byte range of any real CFI insn. */ |
128 | #define CFI_adjust_cfa_offset 0x100 | |
129 | #define CFI_return_column 0x101 | |
130 | #define CFI_rel_offset 0x102 | |
131 | #define CFI_escape 0x103 | |
132 | #define CFI_signal_frame 0x104 | |
133 | #define CFI_val_encoded_addr 0x105 | |
69602580 | 134 | #define CFI_label 0x106 |
1bce6bd8 | 135 | |
54cfded0 | 136 | #endif /* DW2GENCFI_H */ |