OSDN Git Service

* real.c (toe64): Remove stale #endif from the last change.
[pf3gnuchains/gcc-fork.git] / gcc / frame.h
1 /* Header file for unwinding stack frames for exception handling.  */
2 /* Compile this one with gcc.  */
3 /* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
4    Contributed by Jason Merrill <jason@cygnus.com>.
5
6 This file is part of GNU CC.
7
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)
11 any later version.
12
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.
17
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.  */
22
23
24 #ifndef DWARF_FRAME_REGISTERS
25 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
26 #endif
27
28 typedef struct frame_state
29 {
30   void *cfa;
31   void *eh_ptr;
32   long cfa_offset;
33   long args_size;
34   long reg_or_offset[DWARF_FRAME_REGISTERS+1];
35   unsigned short cfa_reg;
36   unsigned short retaddr_column;
37   char saved[DWARF_FRAME_REGISTERS+1];
38 } frame_state;
39
40 /* Values for 'saved' above.  */
41 #define REG_UNSAVED 0
42 #define REG_SAVED_OFFSET 1
43 #define REG_SAVED_REG 2
44
45 /* The representation for an "object" to be searched for frame unwind info.
46    For targets with named sections, one object is an executable or shared
47    library; for other targets, one object is one translation unit.
48
49    A copy of this structure declaration is printed by collect2.c;
50    keep the copies synchronized!  */
51
52 struct object {
53   void *pc_begin;
54   void *pc_end;
55   struct dwarf_fde *fde_begin;
56   struct dwarf_fde **fde_array;
57   size_t count;
58   struct object *next;
59 };
60
61 /* Note the following routines are exported interfaces from libgcc; do not
62    change these interfaces.  Instead create new interfaces.  Also note
63    references to these functions may be made weak in files where they
64    are referenced.  */
65
66 extern void __register_frame (void * );
67 extern void __register_frame_table (void *);
68 extern void __deregister_frame (void *);
69
70 /* Called either from crtbegin.o or a static constructor to register the
71    unwind info for an object or translation unit, respectively.  */
72
73 extern void __register_frame_info (void *, struct object *);
74
75 /* Similar, but BEGIN is actually a pointer to a table of unwind entries
76    for different translation units.  Called from the file generated by
77    collect2.  */
78 extern void __register_frame_info_table (void *, struct object *);
79
80 /* Called from crtend.o to deregister the unwind info for an object.  */
81
82 extern void *__deregister_frame_info (void *);
83
84 /* Called from __throw to find the registers to restore for a given
85    PC_TARGET.  The caller should allocate a local variable of `struct
86    frame_state' (declared in frame.h) and pass its address to STATE_IN.
87    Returns NULL on failure, otherwise returns STATE_IN.  */
88
89 extern struct frame_state *__frame_state_for (void *, struct frame_state *);