2003-06-08 Andrew Cagney <cagney@redhat.com>
[platform/upstream/binutils.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 struct trad_frame
26 {
27   /* If non-zero (and regnum >= 0), the stack address at which the
28      register is saved.  By default, it is assumed that the register
29      was not saved (addr == 0).  Remember, a LONGEST can always fit a
30      CORE_ADDR.  */
31   LONGEST addr;
32   /* else, if regnum >=0 (and addr == 0), the REGNUM that contains
33      this registers value.  By default, it is assumed that the
34      registers are not moved (the register's value is still in that
35      register and regnum == the index).  */
36   int regnum;
37   /* else, if regnum < 0, ADDR is the registers value.  */
38 };
39
40 /* Convenience function, encode the register's value in the
41    trad-frame.  */
42 void trad_frame_register_value (struct trad_frame this_saved_regs[],
43                                 int regnum, LONGEST val);
44
45 /* Return a freshly allocated (and initialized) trad_frame array.  */
46 struct trad_frame *trad_frame_alloc_saved_regs (struct frame_info *next_frame);
47
48 /* Given the trad_frame info, return the location of the specified
49    register.  */
50 void trad_frame_prev_register (struct frame_info *next_frame,
51                                struct trad_frame this_saved_regs[],
52                                int regnum, int *optimizedp,
53                                enum lval_type *lvalp, CORE_ADDR *addrp,
54                                int *realnump, void *bufferp);
55
56 #endif