OSDN Git Service

2003-06-08 Andrew Cagney <cagney@redhat.com>
[pf3gnuchains/pf3gnuchains3x.git] / gdb / trad-frame.h
1 /* Traditional frame unwind support, for GDB the GNU Debugger.
2
3    Copyright 2003 Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.  */
21
22 #ifndef TRAD_FRAME_H
23 #define TRAD_FRAME_H
24
25 /* A traditional saved regs table, indexed by REGNUM, encoding where
26    the value of REGNUM for the previous frame can be found in this
27    frame.
28
29    The table is initialized with an identity encoding (ADDR == 0,
30    REALNUM == REGNUM) indicating that the value of REGNUM in the
31    previous frame can be found in register REGNUM (== REALNUM) in this
32    frame.
33
34    The initial encoding can then be changed:
35
36    Modify ADDR (REALNUM >= 0, ADDR != 0) to indicate that the value of
37    register REGNUM in the previous frame can be found in memory at
38    ADDR in this frame.
39
40    Modify REALNUM (REALNUM >= 0, ADDR == 0) to indicate that the value
41    of register REGNUM in the previous frame is found in register
42    REALNUM in this frame.
43
44    Call trad_frame_register_value (REALNUM < 0) to indicate that the
45    value of register REGNUM in the previous frame is found in ADDR.  */
46
47 struct trad_frame_saved_reg
48 {
49   LONGEST addr; /* A CORE_ADDR fits in a longest.  */
50   int realnum;
51 };
52
53 /* Convenience function, encode REGNUM's location in the trad-frame.  */
54 void trad_frame_register_value (struct trad_frame_saved_reg this_saved_regs[],
55                                 int regnum, LONGEST val);
56
57 /* Return a freshly allocated (and initialized) trad_frame array.  */
58 struct trad_frame_saved_reg *trad_frame_alloc_saved_regs (struct frame_info *next_frame);
59
60 /* Given the trad_frame info, return the location of the specified
61    register.  */
62 void trad_frame_prev_register (struct frame_info *next_frame,
63                                struct trad_frame_saved_reg this_saved_regs[],
64                                int regnum, int *optimizedp,
65                                enum lval_type *lvalp, CORE_ADDR *addrp,
66                                int *realnump, void *bufferp);
67
68 #endif