/* Code dealing with dummy stack frames, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
- Software Foundation, Inc.
+ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
+ Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include "defs.h"
/* Function: deprecated_pc_in_call_dummy (pc)
Return non-zero if the PC falls in a dummy frame created by gdb for
- an inferior call. The code below which allows DECR_PC_AFTER_BREAK
+ an inferior call. The code below which allows gdbarch_decr_pc_after_break
is for infrun.c, which may give the function a PC without that
subtracted out.
dummyframe = dummyframe->next)
{
if ((pc >= dummyframe->id.code_addr)
- && (pc <= dummyframe->id.code_addr + DECR_PC_AFTER_BREAK))
+ && (pc <= dummyframe->id.code_addr
+ + gdbarch_decr_pc_after_break (current_gdbarch)))
return 1;
}
return 0;
entry point, or some random address on the stack. Trying to use
that PC to apply standard frame ID unwind techniques is just
asking for trouble. */
- /* Use an architecture specific method to extract the prev's dummy
- ID from the next frame. Note that this method uses
- frame_register_unwind to obtain the register values needed to
- determine the dummy frame's ID. */
- this_id = gdbarch_unwind_dummy_id (get_frame_arch (next_frame), next_frame);
-
- /* Use that ID to find the corresponding cache entry. */
- for (dummyframe = dummy_frame_stack;
- dummyframe != NULL;
- dummyframe = dummyframe->next)
+
+ /* Don't bother unles there is at least one dummy frame. */
+ if (dummy_frame_stack != NULL)
{
- if (frame_id_eq (dummyframe->id, this_id))
+ /* Use an architecture specific method to extract the prev's
+ dummy ID from the next frame. Note that this method uses
+ frame_register_unwind to obtain the register values needed to
+ determine the dummy frame's ID. */
+ this_id = gdbarch_unwind_dummy_id (get_frame_arch (next_frame),
+ next_frame);
+
+ /* Use that ID to find the corresponding cache entry. */
+ for (dummyframe = dummy_frame_stack;
+ dummyframe != NULL;
+ dummyframe = dummyframe->next)
{
- struct dummy_frame_cache *cache;
- cache = FRAME_OBSTACK_ZALLOC (struct dummy_frame_cache);
- cache->prev_regcache = dummyframe->regcache;
- cache->this_id = this_id;
- (*this_prologue_cache) = cache;
- return 1;
+ if (frame_id_eq (dummyframe->id, this_id))
+ {
+ struct dummy_frame_cache *cache;
+ cache = FRAME_OBSTACK_ZALLOC (struct dummy_frame_cache);
+ cache->prev_regcache = dummyframe->regcache;
+ cache->this_id = this_id;
+ (*this_prologue_cache) = cache;
+ return 1;
+ }
}
}
return 0;
void **this_prologue_cache,
int regnum, int *optimized,
enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnum, void *bufferp)
+ int *realnum, gdb_byte *bufferp)
{
/* The dummy-frame sniffer always fills in the cache. */
struct dummy_frame_cache *cache = (*this_prologue_cache);