/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GDB.
/* Methods for constructing and comparing Frame IDs. */
-/* For convenience. All fields are zero. */
+/* For convenience. All fields are zero. This means "there is no frame". */
extern const struct frame_id null_frame_id;
+/* This means "there is no frame ID, but there is a frame". It should be
+ replaced by best-effort frame IDs for the outermost frame, somehow.
+ The implementation is only special_addr_p set. */
+extern const struct frame_id outer_frame_id;
+
/* Flag to control debugging. */
extern int frame_debug;
/* Construct a special frame ID. The first parameter is the frame's constant
stack address (typically the outer-bound), the second is the
frame's constant code address (typically the entry point),
- and the third parameter is the frame's special identifier address. */
+ and the third parameter is the frame's special identifier address. */
extern struct frame_id frame_id_build_special (CORE_ADDR stack_addr,
CORE_ADDR code_addr,
CORE_ADDR special_addr);
extern struct frame_id frame_id_build_wild (CORE_ADDR stack_addr);
/* Returns non-zero when L is a valid frame (a valid frame has a
- non-zero .base). */
+ non-zero .base). The outermost frame is valid even without an
+ ID. */
extern int frame_id_p (struct frame_id l);
/* Returns non-zero when L is a valid frame representing an inlined
call. */
DUMMY_FRAME,
/* A frame representing an inlined function, associated with an
- upcoming (next, inner, younger) NORMAL_FRAME. */
+ upcoming (prev, outer, older) NORMAL_FRAME. */
INLINE_FRAME,
/* In a signal handler, various OSs handle this in various ways.
The main thing is that the frame may be far from normal. */
extern enum frame_type get_frame_type (struct frame_info *);
+/* Return the frame's program space. */
+extern struct program_space *get_frame_program_space (struct frame_info *);
+
+/* Unwind THIS frame's program space from the NEXT frame. */
+extern struct program_space *frame_unwind_program_space (struct frame_info *);
+
+/* Return the frame's address space. */
+extern struct address_space *get_frame_address_space (struct frame_info *);
+
/* For frames where we can not unwind further, describe why. */
enum unwind_stop_reason
/* Values for the source flag to be used in print_frame_info_base(). */
enum print_what
{
- /* Print only the source line, like in stepi. */
+ /* Print only the source line, like in stepi. */
SRC_LINE = -1,
/* Print only the location, i.e. level, address (sometimes)
- function, args, file, line, line num. */
+ function, args, file, line, line num. */
LOCATION,
- /* Print both of the above. */
+ /* Print both of the above. */
SRC_AND_LOC,
- /* Print location only, but always include the address. */
+ /* Print location only, but always include the address. */
LOC_AND_ADDRESS
};
allocate memory using this method. */
extern void *frame_obstack_zalloc (unsigned long size);
-#define FRAME_OBSTACK_ZALLOC(TYPE) ((TYPE *) frame_obstack_zalloc (sizeof (TYPE)))
-#define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE)))
+#define FRAME_OBSTACK_ZALLOC(TYPE) \
+ ((TYPE *) frame_obstack_zalloc (sizeof (TYPE)))
+#define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) \
+ ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE)))
/* Create a regcache, and copy the frame's registers into it. */
struct regcache *frame_save_as_regcache (struct frame_info *this_frame);
extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc);
+/* Return true if the frame unwinder for frame FI is UNWINDER; false
+ otherwise. */
+
+extern int frame_unwinder_is (struct frame_info *fi,
+ const struct frame_unwind *unwinder);
+
#endif /* !defined (FRAME_H) */