]> gcc.gnu.org Git - gcc.git/blame - gcc/frame.h
reload.c: PROTO -> PARAMS.
[gcc.git] / gcc / frame.h
CommitLineData
4283012f
JL
1/* Header file for unwinding stack frames for exception handling. */
2/* Compile this one with gcc. */
3073d01c 3/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
4283012f
JL
4 Contributed by Jason Merrill <jason@cygnus.com>.
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING. If not, write to
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
22
4877a06f 23
3073d01c
ML
24#ifndef DWARF_FRAME_REGISTERS
25#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
26#endif
27
4877a06f
JM
28typedef struct frame_state
29{
30 void *cfa;
31 void *eh_ptr;
32 long cfa_offset;
33 long args_size;
3073d01c 34 long reg_or_offset[DWARF_FRAME_REGISTERS+1];
4877a06f
JM
35 unsigned short cfa_reg;
36 unsigned short retaddr_column;
3073d01c 37 char saved[DWARF_FRAME_REGISTERS+1];
4877a06f
JM
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
956d6950
JL
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
52struct 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
8f08ea1e
L
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
a3fd4e75
JL
66extern void __register_frame (void * );
67extern void __register_frame_table (void *);
68extern void __deregister_frame (void *);
69
4877a06f
JM
70/* Called either from crtbegin.o or a static constructor to register the
71 unwind info for an object or translation unit, respectively. */
72
6d8ccdbb
JL
73extern 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. */
78extern void __register_frame_info_table (void *, struct object *);
4877a06f
JM
79
80/* Called from crtend.o to deregister the unwind info for an object. */
81
a3fd4e75 82extern void *__deregister_frame_info (void *);
4877a06f
JM
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
89extern struct frame_state *__frame_state_for (void *, struct frame_state *);
This page took 0.445795 seconds and 5 git commands to generate.