1 /* Header file for unwinding stack frames for exception handling. */
2 /* Compile this one with gcc. */
3 /* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
4 Contributed by Jason Merrill <jason@cygnus.com>.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 typedef struct frame_state
30 long reg_or_offset[FIRST_PSEUDO_REGISTER+1];
31 unsigned short cfa_reg;
32 unsigned short retaddr_column;
33 char saved[FIRST_PSEUDO_REGISTER+1];
36 /* Values for 'saved' above. */
38 #define REG_SAVED_OFFSET 1
39 #define REG_SAVED_REG 2
41 /* The representation for an "object" to be searched for frame unwind info.
42 For targets with named sections, one object is an executable or shared
43 library; for other targets, one object is one translation unit.
45 A copy of this structure declaration is printed by collect2.c;
46 keep the copies synchronized! */
51 struct dwarf_fde *fde_begin;
52 struct dwarf_fde **fde_array;
57 extern void __register_frame (void * );
58 extern void __register_frame_table (void *);
59 extern void __deregister_frame (void *);
61 /* Called either from crtbegin.o or a static constructor to register the
62 unwind info for an object or translation unit, respectively. */
64 extern void __register_frame_info (void *, struct object *);
66 /* Similar, but BEGIN is actually a pointer to a table of unwind entries
67 for different translation units. Called from the file generated by
69 extern void __register_frame_info_table (void *, struct object *);
71 /* Called from crtend.o to deregister the unwind info for an object. */
73 extern void *__deregister_frame_info (void *);
75 /* Called from __throw to find the registers to restore for a given
76 PC_TARGET. The caller should allocate a local variable of `struct
77 frame_state' (declared in frame.h) and pass its address to STATE_IN.
78 Returns NULL on failure, otherwise returns STATE_IN. */
80 extern struct frame_state *__frame_state_for (void *, struct frame_state *);