OSDN Git Service

Copyright fixes.
[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 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 typedef struct frame_state
25 {
26   void *cfa;
27   void *eh_ptr;
28   long cfa_offset;
29   long args_size;
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];
34 } frame_state;
35
36 /* Values for 'saved' above.  */
37 #define REG_UNSAVED 0
38 #define REG_SAVED_OFFSET 1
39 #define REG_SAVED_REG 2
40
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.
44
45    A copy of this structure declaration is printed by collect2.c;
46    keep the copies synchronized!  */
47
48 struct object {
49   void *pc_begin;
50   void *pc_end;
51   struct dwarf_fde *fde_begin;
52   struct dwarf_fde **fde_array;
53   size_t count;
54   struct object *next;
55 };
56
57 extern void __register_frame (void * );
58 extern void __register_frame_table (void *);
59 extern void __deregister_frame (void *);
60
61 /* Called either from crtbegin.o or a static constructor to register the
62    unwind info for an object or translation unit, respectively.  */
63
64 extern void __register_frame_info (void *, struct object *);
65
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
68    collect2.  */
69 extern void __register_frame_info_table (void *, struct object *);
70
71 /* Called from crtend.o to deregister the unwind info for an object.  */
72
73 extern void *__deregister_frame_info (void *);
74
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.  */
79
80 extern struct frame_state *__frame_state_for (void *, struct frame_state *);