2004-02-12 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / dwarf2-frame.h
CommitLineData
cfc14b3a
MK
1/* Frame unwinder for frames with DWARF Call Frame Information.
2
05cbe71a 3 Copyright 2003, 2004 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
11 the Free Software Foundation; either version 2 of the License, or
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
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
23
24#ifndef DWARF2_FRAME_H
25#define DWARF2_FRAME_H 1
26
27struct objfile;
e6e5e94c 28struct frame_info;
cfc14b3a 29
05cbe71a
MK
30/* Register rule. */
31
32enum dwarf2_frame_reg_rule
33{
34 /* Make certain that 0 maps onto the correct enum value; the
35 corresponding structure is being initialized using memset zero.
36 This indicates that CFI didn't provide any information at all
37 about a register, leaving how to obtain its value totally
38 unspecified. */
39 DWARF2_FRAME_REG_UNSPECIFIED = 0,
40
41 /* The term "undefined" comes from the DWARF2 CFI spec which this
42 code is moddeling; it indicates that the register's value is
43 "undefined". GCC uses the less formal term "unsaved". Its
44 definition is a combination of REG_UNDEFINED and REG_UNSPECIFIED.
45 The failure to differentiate the two helps explain a few problems
46 with the CFI generated by GCC. */
47 DWARF2_FRAME_REG_UNDEFINED,
48 DWARF2_FRAME_REG_SAVED_OFFSET,
49 DWARF2_FRAME_REG_SAVED_REG,
50 DWARF2_FRAME_REG_SAVED_EXP,
51 DWARF2_FRAME_REG_SAME_VALUE,
52
53 /* These aren't defined by the DWARF2 CFI specification, but are
54 used internally by GDB. */
55 DWARF2_FRAME_REG_RA, /* Return Address. */
56 DWARF2_FRAME_REG_CFA /* Call Frame Address. */
57};
58
59/* Register state. */
60
61struct dwarf2_frame_state_reg
62{
63 /* Each register save state can be described in terms of a CFA slot,
64 another register, or a location expression. */
65 union {
66 LONGEST offset;
67 ULONGEST reg;
68 unsigned char *exp;
69 } loc;
70 ULONGEST exp_len;
71 enum dwarf2_frame_reg_rule how;
72};
73
cfc14b3a
MK
74/* Return the frame unwind methods for the function that contains PC,
75 or NULL if it can't be handled by DWARF CFI frame unwinder. */
76
05cbe71a
MK
77extern const struct frame_unwind *
78 dwarf2_frame_sniffer (struct frame_info *next_frame);
cfc14b3a
MK
79
80/* Return the frame base methods for the function that contains PC, or
81 NULL if it can't be handled by the DWARF CFI frame unwinder. */
82
05cbe71a
MK
83extern const struct frame_base *
84 dwarf2_frame_base_sniffer (struct frame_info *next_frame);
cfc14b3a
MK
85
86/* Register the DWARF CFI for OBJFILE. */
87
88void dwarf2_frame_build_info (struct objfile *objfile);
89
90#endif /* dwarf2-frame.h */
This page took 0.079814 seconds and 4 git commands to generate.