* symtab.h (enum address_class): Remove LOC_INDIRECT and
[deliverable/binutils-gdb.git] / gdb / dwarf2-frame.h
CommitLineData
cfc14b3a
MK
1/* Frame unwinder for frames with DWARF Call Frame Information.
2
9b254dd1 3 Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
cfc14b3a
MK
4
5 Contributed by Mark Kettenis.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
a9762ec7 11 the Free Software Foundation; either version 3 of the License, or
cfc14b3a
MK
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
a9762ec7 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
cfc14b3a
MK
21
22#ifndef DWARF2_FRAME_H
23#define DWARF2_FRAME_H 1
24
ecc9ac84 25struct gdbarch;
cfc14b3a 26struct objfile;
e6e5e94c 27struct frame_info;
cfc14b3a 28
05cbe71a
MK
29/* Register rule. */
30
31enum dwarf2_frame_reg_rule
32{
33 /* Make certain that 0 maps onto the correct enum value; the
34 corresponding structure is being initialized using memset zero.
35 This indicates that CFI didn't provide any information at all
36 about a register, leaving how to obtain its value totally
37 unspecified. */
38 DWARF2_FRAME_REG_UNSPECIFIED = 0,
39
40 /* The term "undefined" comes from the DWARF2 CFI spec which this
41 code is moddeling; it indicates that the register's value is
42 "undefined". GCC uses the less formal term "unsaved". Its
43 definition is a combination of REG_UNDEFINED and REG_UNSPECIFIED.
44 The failure to differentiate the two helps explain a few problems
45 with the CFI generated by GCC. */
46 DWARF2_FRAME_REG_UNDEFINED,
47 DWARF2_FRAME_REG_SAVED_OFFSET,
48 DWARF2_FRAME_REG_SAVED_REG,
49 DWARF2_FRAME_REG_SAVED_EXP,
50 DWARF2_FRAME_REG_SAME_VALUE,
51
46ea248b
AO
52 /* These are defined in Dwarf3. */
53 DWARF2_FRAME_REG_SAVED_VAL_OFFSET,
54 DWARF2_FRAME_REG_SAVED_VAL_EXP,
55
05cbe71a
MK
56 /* These aren't defined by the DWARF2 CFI specification, but are
57 used internally by GDB. */
b39cc962 58 DWARF2_FRAME_REG_FN, /* Call a registered function. */
05cbe71a 59 DWARF2_FRAME_REG_RA, /* Return Address. */
8d5a9abc 60 DWARF2_FRAME_REG_RA_OFFSET, /* Return Address with offset. */
ea7963f0
FR
61 DWARF2_FRAME_REG_CFA, /* Call Frame Address. */
62 DWARF2_FRAME_REG_CFA_OFFSET /* Call Frame Address with offset. */
05cbe71a
MK
63};
64
65/* Register state. */
66
67struct dwarf2_frame_state_reg
68{
69 /* Each register save state can be described in terms of a CFA slot,
70 another register, or a location expression. */
71 union {
72 LONGEST offset;
73 ULONGEST reg;
74 unsigned char *exp;
b39cc962
DJ
75 struct value *(*fn) (struct frame_info *this_frame, void **this_cache,
76 int regnum);
05cbe71a
MK
77 } loc;
78 ULONGEST exp_len;
79 enum dwarf2_frame_reg_rule how;
80};
81
8f22cb90
MK
82/* Set the architecture-specific register state initialization
83 function for GDBARCH to INIT_REG. */
84
85extern void dwarf2_frame_set_init_reg (struct gdbarch *gdbarch,
86 void (*init_reg) (struct gdbarch *, int,
aff37fc1
DM
87 struct dwarf2_frame_state_reg *,
88 struct frame_info *));
8f22cb90 89
3ed09a32
DJ
90/* Set the architecture-specific signal trampoline recognition
91 function for GDBARCH to SIGNAL_FRAME_P. */
92
93extern void
94 dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch,
95 int (*signal_frame_p) (struct gdbarch *,
96 struct frame_info *));
97
4fc771b8
DJ
98/* Set the architecture-specific adjustment of .eh_frame and .debug_frame
99 register numbers. */
4bf8967c
AS
100
101extern void
4fc771b8
DJ
102 dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch,
103 int (*adjust_regnum) (struct gdbarch *,
104 int, int));
4bf8967c 105
4a4e5149 106/* Append the DWARF-2 frame unwinders to GDBARCH's list. */
cfc14b3a 107
4a4e5149 108void dwarf2_append_unwinders (struct gdbarch *gdbarch);
cfc14b3a
MK
109
110/* Return the frame base methods for the function that contains PC, or
111 NULL if it can't be handled by the DWARF CFI frame unwinder. */
112
05cbe71a 113extern const struct frame_base *
4a4e5149 114 dwarf2_frame_base_sniffer (struct frame_info *this_frame);
cfc14b3a
MK
115
116/* Register the DWARF CFI for OBJFILE. */
117
118void dwarf2_frame_build_info (struct objfile *objfile);
119
120#endif /* dwarf2-frame.h */
This page took 0.363111 seconds and 4 git commands to generate.