]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/frame.h
Initial revision
[thirdparty/binutils-gdb.git] / gdb / frame.h
CommitLineData
bd5635a1
RP
1/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
2 Copyright (C) 1986, 1989 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6GDB is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option)
9any later version.
10
11GDB is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GDB; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20#if !defined (FRAME_H)
21#define FRAME_H 1
22#include "param.h"
23
24/*
25 * FRAME is the type of the identifier of a specific stack frame. It
26 * is a pointer to the frame cache item corresponding to this frame.
27 * Please note that frame id's are *not* constant over calls to the
28 * inferior. Use frame addresses, which are.
29 *
30 * FRAME_ADDR is the type of the address of a specific frame. I
31 * cannot imagine a case in which this would not be CORE_ADDR, so
32 * maybe it's silly to give it it's own type. Life's rough.
33 *
34 * FRAME_FP is a macro which converts from a frame identifier into a
35 * frame_address.
36 *
37 * FRAME_INFO_ID is a macro which "converts" from a frame info pointer
38 * to a frame id. This is here in case I or someone else decides to
39 * change the FRAME type again.
40 *
41 * This file and blockframe.c are the only places which are allowed to
42 * use the equivalence between FRAME and struct frame_info *. EXCEPTION:
43 * value.h uses CORE_ADDR instead of FRAME_ADDR because the compiler
44 * will accept that in the absense of this file.
45 */
46typedef struct frame_info *FRAME;
47typedef CORE_ADDR FRAME_ADDR;
48#define FRAME_FP(fr) ((fr)->frame)
49#define FRAME_INFO_ID(f) (f)
50
51/*
52 * Caching structure for stack frames. This is also the structure
53 * used for extended info about stack frames. May add more to this
54 * structure as it becomes necessary.
55 *
56 * Note that the first entry in the cache will always refer to the
57 * innermost executing frame. This value should be set (is it?
58 * Check) in something like normal_stop.
59 */
60struct frame_info
61 {
62 /* Nominal address of the frame described. */
63 FRAME_ADDR frame;
64 /* Address at which execution is occurring in this frame.
65 For the innermost frame, it's the current pc.
66 For other frames, it is a pc saved in the next frame. */
67 CORE_ADDR pc;
68 /* The frame called by the frame we are describing, or 0.
69 This may be set even if there isn't a frame called by the one
70 we are describing (.->next == 0); in that case it is simply the
71 bottom of this frame */
72 FRAME_ADDR next_frame;
73 /* Anything extra for this structure that may have been defined
74 in the machine depedent files. */
75#ifdef EXTRA_FRAME_INFO
76 EXTRA_FRAME_INFO
77#endif
78 /* Pointers to the next and previous frame_info's in this stack. */
79 FRAME next, prev;
80 };
81
82/* Describe the saved registers of a frame. */
83
84struct frame_saved_regs
85 {
86 /* For each register, address of where it was saved on entry to the frame,
87 or zero if it was not saved on entry to this frame. */
88 CORE_ADDR regs[NUM_REGS];
89 };
90
91/* The stack frame that the user has specified for commands to act on.
92 Note that one cannot assume this is the address of valid data. */
93
94extern FRAME selected_frame;
95
96extern struct frame_info *get_frame_info ();
97extern struct frame_info *get_prev_frame_info ();
98
99extern FRAME create_new_frame ();
100extern void flush_cached_frames ();
101
102extern void get_frame_saved_regs ();
103
104extern void set_current_frame ();
105extern FRAME get_prev_frame ();
106extern FRAME get_current_frame ();
107extern FRAME get_next_frame ();
108
109extern struct block *get_frame_block ();
110extern struct block *get_current_block ();
111extern struct block *get_selected_block ();
112extern struct symbol *get_frame_function ();
113extern CORE_ADDR get_frame_pc ();
114extern CORE_ADDR get_pc_function_start ();
115struct block *block_for_pc ();
116
117int frameless_look_for_prologue ();
118
119void print_frame_args ();
120
121/* In stack.c */
122extern FRAME find_relative_frame ();
123extern void print_selected_frame ();
124extern void print_sel_frame ();
125extern void select_frame ();
126extern void record_selected_frame ();
127
128#endif /* frame.h not already included. */