2010-07-27 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc/alias-decl.git] / gcc / unwind-dw2.h
blob2c558b4962aac507b465f9cf825a0bf7dda93c13
1 /* DWARF2 frame unwind data structure.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2009
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 /* A target can override (perhaps for backward compatibility) how
27 many dwarf2 columns are unwound. */
28 #ifndef DWARF_FRAME_REGISTERS
29 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
30 #endif
32 /* The result of interpreting the frame unwind info for a frame.
33 This is all symbolic at this point, as none of the values can
34 be resolved until the target pc is located. */
35 typedef struct
37 /* Each register save state can be described in terms of a CFA slot,
38 another register, or a location expression. */
39 struct frame_state_reg_info
41 struct {
42 union {
43 _Unwind_Word reg;
44 _Unwind_Sword offset;
45 const unsigned char *exp;
46 } loc;
47 enum {
48 REG_UNSAVED,
49 REG_SAVED_OFFSET,
50 REG_SAVED_REG,
51 REG_SAVED_EXP,
52 REG_SAVED_VAL_OFFSET,
53 REG_SAVED_VAL_EXP,
54 REG_UNDEFINED
55 } how;
56 } reg[DWARF_FRAME_REGISTERS+1];
58 /* Used to implement DW_CFA_remember_state. */
59 struct frame_state_reg_info *prev;
61 /* The CFA can be described in terms of a reg+offset or a
62 location expression. */
63 _Unwind_Sword cfa_offset;
64 _Unwind_Word cfa_reg;
65 const unsigned char *cfa_exp;
66 enum {
67 CFA_UNSET,
68 CFA_REG_OFFSET,
69 CFA_EXP
70 } cfa_how;
71 } regs;
73 /* The PC described by the current frame state. */
74 void *pc;
76 /* The information we care about from the CIE/FDE. */
77 _Unwind_Personality_Fn personality;
78 _Unwind_Sword data_align;
79 _Unwind_Word code_align;
80 _Unwind_Word retaddr_column;
81 unsigned char fde_encoding;
82 unsigned char lsda_encoding;
83 unsigned char saw_z;
84 unsigned char signal_frame;
85 void *eh_ptr;
86 } _Unwind_FrameState;