1 /* Definitions for dealing with stack frames, for GDB, the GNU debugger.
2 Copyright (C) 1986, 1989 Free Software Foundation, Inc.
4 This file is part of GDB.
6 GDB is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option)
11 GDB is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GDB; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* Note that frame.h requires param.h! */
23 * FRAME is the type of the identifier of a specific stack frame. It
24 * is a pointer to the frame cache item corresponding to this frame.
25 * Please note that frame id's are *not* constant over calls to the
26 * inferior. Use frame addresses, which are.
28 * FRAME_ADDR is the type of the address of a specific frame. I
29 * cannot imagine a case in which this would not be CORE_ADDR, so
30 * maybe it's silly to give it it's own type. Life's rough.
32 * FRAME_FP is a macro which converts from a frame identifier into a
35 * FRAME_INFO_ID is a macro which "converts" from a frame info pointer
36 * to a frame id. This is here in case I or someone else decides to
37 * change the FRAME type again.
39 * This file and blockframe.c are the only places which are allowed to
40 * use the equivalence between FRAME and struct frame_info *. EXCEPTION:
41 * value.h uses CORE_ADDR instead of FRAME_ADDR because the compiler
42 * will accept that in the absense of this file.
44 typedef struct frame_info
*FRAME
;
45 typedef CORE_ADDR FRAME_ADDR
;
46 #define FRAME_FP(fr) ((fr)->frame)
47 #define FRAME_INFO_ID(f) (f)
50 * Caching structure for stack frames. This is also the structure
51 * used for extended info about stack frames. May add more to this
52 * structure as it becomes necessary.
54 * Note that the first entry in the cache will always refer to the
55 * innermost executing frame. This value should be set (is it?
56 * Check) in something like normal_stop.
60 /* Nominal address of the frame described. */
62 /* Address at which execution is occurring in this frame.
63 For the innermost frame, it's the current pc.
64 For other frames, it is a pc saved in the next frame. */
66 /* The frame called by the frame we are describing, or 0.
67 This may be set even if there isn't a frame called by the one
68 we are describing (.->next == 0); in that case it is simply the
69 bottom of this frame */
70 FRAME_ADDR next_frame
;
71 /* Anything extra for this structure that may have been defined
72 in the machine depedent files. */
73 #ifdef EXTRA_FRAME_INFO
76 /* Pointers to the next and previous frame_info's in this stack. */
80 /* Describe the saved registers of a frame. */
82 struct frame_saved_regs
84 /* For each register, address of where it was saved on entry to the frame,
85 or zero if it was not saved on entry to this frame. */
86 CORE_ADDR regs
[NUM_REGS
];
89 /* The stack frame that the user has specified for commands to act on.
90 Note that one cannot assume this is the address of valid data. */
92 extern FRAME selected_frame
;
94 extern struct frame_info
*get_frame_info ();
95 extern struct frame_info
*get_prev_frame_info ();
97 extern FRAME
create_new_frame ();
99 extern void get_frame_saved_regs ();
101 extern FRAME
get_prev_frame ();
102 extern FRAME
get_current_frame ();
103 extern FRAME
get_next_frame ();
105 extern struct block
*get_frame_block ();
106 extern struct block
*get_current_block ();
107 extern struct block
*get_selected_block ();
108 extern struct symbol
*get_frame_function ();
109 extern struct symbol
*get_pc_function ();
112 extern FRAME
find_relative_frame ();