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