* d10v-tdep.c (d10v_frame_chain_valid): Remove unnecessary tests.
* hppa-tdep.c (hppa_frame_chain_valid): Remove unnecessary test.
* blockframe.c: Include "gdbcmd.h" and "command.h".
(backtrace_below_main): New variable.
(file_frame_chain_valid, func_frame_chain_valid)
(nonnull_frame_chain_valid, generic_file_frame_chain_valid)
(generic_func_frame_chain_valid): Remove functions.
(frame_chain_valid, do_flush_frames_sfunc): New functions.
(_initialize_blockframe): New function.
* Makefile.in (blockframe.o): Update dependencies.
* frame.c (frame_saved_regs_id_unwind, get_prev_frame): Remove FIXME
comment. Call frame_chain_valid ().
* frame.h: Remove old prototypes. Add prototype for
frame_chain_valid and update comments to match.
* gdbarch.sh: Change FRAME_CHAIN_VALID into a predicated function.
Remove old comment.
* gdbarch.h: Regenerated.
* gdbarch.c: Regenerated.
Plus updates to all other targets not to provide a FRAME_CHAIN_VALID.
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c (arm_frame_chain_valid): Remove unnecessary test.
+ * d10v-tdep.c (d10v_frame_chain_valid): Remove unnecessary tests.
+ * hppa-tdep.c (hppa_frame_chain_valid): Remove unnecessary test.
+
+ * blockframe.c: Include "gdbcmd.h" and "command.h".
+ (backtrace_below_main): New variable.
+ (file_frame_chain_valid, func_frame_chain_valid)
+ (nonnull_frame_chain_valid, generic_file_frame_chain_valid)
+ (generic_func_frame_chain_valid): Remove functions.
+ (frame_chain_valid, do_flush_frames_sfunc): New functions.
+ (_initialize_blockframe): New function.
+ * Makefile.in (blockframe.o): Update dependencies.
+ * frame.c (frame_saved_regs_id_unwind, get_prev_frame): Remove FIXME
+ comment. Call frame_chain_valid ().
+ * frame.h: Remove old prototypes. Add prototype for
+ frame_chain_valid and update comments to match.
+ * gdbarch.sh: Change FRAME_CHAIN_VALID into a predicated function.
+ Remove old comment.
+ * gdbarch.h: Regenerated.
+ * gdbarch.c: Regenerated.
+
+ * alpha-tdep.c (alpha_gdbarch_init): Don't call
+ set_gdbarch_frame_chain_valid.
+ * avr-tdep.c (avr_gdbarch_init): Likewise.
+ * cris-tdep.c (cris_gdbarch_init): Likewise.
+ * frv-tdep.c (frv_gdbarch_init): Likewise.
+ * h8300-tdep.c (h8300_gdbarch_init): Likewise.
+ * i386-tdep.c (i386_svr4_init_abi): Likewise.
+ (i386_nw_init_abi): Likewise.
+ (i386_gdbarch_init): Likewise.
+ * ia64-tdep.c (ia64_gdbarch_init): Likewise.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise.
+ * m68k-tdep.c (m68k_gdbarch_init): Likewise.
+ * mcore-tdep.c (mcore_gdbarch_init): Likewise.
+ * mips-tdep.c (mips_gdbarch_init): Likewise.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Likewise.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Likewise.
+ * ppcnbsd-tdep.c (ppcnbsd_init_abi): Likewise.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
+ * s390-tdep.c (s390_gdbarch_init): Likewise.
+ * sh-tdep.c (sh_gdbarch_init): Likewise.
+ * sparc-tdep.c (sparc_gdbarch_init): Likewise.
+ * v850-tdep.c (v850_gdbarch_init): Likewise.
+ * vax-tdep.c (vax_gdbarch_init): Likewise.
+ * x86-64-tdep.c (x86_64_init_abi): Likewise.
+
+ * config/m32r/tm-m32r.h (FRAME_CHAIN_VALID): Don't define.
+ * config/m68k/tm-apollo68b.h (FRAME_CHAIN_VALID): Likewise.
+ * config/m68k/tm-m68kv4.h (FRAME_CHAIN_VALID): Likewise.
+ * config/m68k/tm-monitor.h (FRAME_CHAIN_VALID): Likewise.
+ * config/m68k/tm-os68k.h (FRAME_CHAIN_VALID): Likewise.
+ * config/m68k/tm-vx68.h (FRAME_CHAIN_VALID): Likewise.
+ * config/mn10200/tm-mn10200.h (FRAME_CHAIN_VALID): Likewise.
+ * config/sparc/tm-sparclite.h (FRAME_CHAIN_VALID): Likewise.
+
2002-01-04 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (acconfig_h): Remove incorrect macro.
blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \
$(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \
- $(dummy_frame_h)
+ $(dummy_frame_h) $(command_h) $(gdbcmd_h)
breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \
$(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \
$(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \
set_gdbarch_saved_pc_after_call (gdbarch, alpha_saved_pc_after_call);
set_gdbarch_frame_chain (gdbarch, alpha_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs);
static int
arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
- return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC));
+ return (FRAME_SAVED_PC (thisframe) >= LOWEST_PC);
}
/* Set to true if the 32-bit mode is in use. */
/* Target-dependent code for Atmel AVR, for GDB.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); /* ??? */
set_gdbarch_frame_chain (gdbarch, avr_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, avr_frame_saved_pc);
set_gdbarch_frame_args_address (gdbarch, avr_frame_address);
set_gdbarch_frame_locals_address (gdbarch, avr_frame_address);
functions and pc values.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This file is part of GDB.
#include "regcache.h"
#include "gdb_assert.h"
#include "dummy-frame.h"
+#include "command.h"
+#include "gdbcmd.h"
-/* Prototypes for exported functions. */
-
-void _initialize_blockframe (void);
+/* Flag to indicate whether backtraces should stop at main. */
-/* A default FRAME_CHAIN_VALID, in the form that is suitable for most
- targets. If FRAME_CHAIN_VALID returns zero it means that the given
- frame is the outermost one and has no caller. */
-
-int
-file_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- return ((chain) != 0
- && !inside_entry_file (frame_pc_unwind (thisframe)));
-}
-
-/* Use the alternate method of avoiding running up off the end of the
- frame chain or following frames back into the startup code. See
- the comments in objfiles.h. */
-
-int
-func_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- return ((chain) != 0
- && !inside_main_func (get_frame_pc (thisframe))
- && !inside_entry_func (get_frame_pc (thisframe)));
-}
+static int backtrace_below_main;
-/* A very simple method of determining a valid frame */
+/* Prototypes for exported functions. */
-int
-nonnull_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- return ((chain) != 0);
-}
+void _initialize_blockframe (void);
/* Is ADDR inside the startup file? Note that if your machine
has a way to detect the bottom of the stack, there is no need
&& (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK));
}
-
/* Function: frame_chain_valid
Returns true for a user frame or a call_function_by_hand dummy frame,
- and false for the CRT0 start-up frame. Purpose is to terminate backtrace */
+ and false for the CRT0 start-up frame. Purpose is to terminate backtrace. */
int
-generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
+frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame_pc_unwind (fi), fp, fp))
- return 1; /* don't prune CALL_DUMMY frames */
- else /* fall back to default algorithm (see frame.h) */
- return (fp != 0
- && (INNER_THAN (get_frame_base (fi), fp)
- || get_frame_base (fi) == fp)
- && !inside_entry_file (frame_pc_unwind (fi)));
+ /* Don't prune CALL_DUMMY frames. */
+ if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
+ return 1;
+
+ /* If the new frame pointer is zero, then it isn't valid. */
+ if (fp == 0)
+ return 0;
+
+ /* If the new frame would be inside (younger than) the previous frame,
+ then it isn't valid. */
+ if (INNER_THAN (fp, get_frame_base (fi)))
+ return 0;
+
+ /* If we're already inside the entry function for the main objfile, then it
+ isn't valid. */
+ if (inside_entry_func (get_frame_pc (fi)))
+ return 0;
+
+ /* If we're inside the entry file, it isn't valid. */
+ /* NOTE/drow 2002-12-25: should there be a way to disable this check? It
+ assumes a single small entry file, and the way some debug readers (e.g.
+ dbxread) figure out which object is the entry file is somewhat hokey. */
+ if (inside_entry_file (frame_pc_unwind (fi)))
+ return 0;
+
+ /* If we want backtraces to stop at main, and we're inside main, then it
+ isn't valid. */
+ if (!backtrace_below_main && inside_main_func (get_frame_pc (fi)))
+ return 0;
+
+ /* If the architecture has a custom FRAME_CHAIN_VALID, call it now. */
+ if (FRAME_CHAIN_VALID_P ())
+ return FRAME_CHAIN_VALID (fp, fi);
+
+ return 1;
}
-int
-generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
+void
+do_flush_frames_sfunc (char *args, int from_tty, struct cmd_list_element *c)
{
- if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- return 1; /* don't prune CALL_DUMMY frames */
- else /* fall back to default algorithm (see frame.h) */
- return (fp != 0
- && (INNER_THAN (get_frame_base (fi), fp)
- || get_frame_base (fi) == fp)
- && !inside_main_func (get_frame_pc (fi))
- && !inside_entry_func (get_frame_pc (fi)));
+ int saved_level;
+ struct frame_info *cur_frame;
+
+ if (! target_has_stack)
+ return;
+
+ saved_level = frame_relative_level (get_selected_frame ());
+
+ flush_cached_frames ();
+
+ cur_frame = find_relative_frame (get_current_frame (), &saved_level);
+ select_frame (cur_frame);
+
+ /* If we were below main and backtrace-below-main was turned off,
+ SAVED_LEVEL will be non-zero. CUR_FRAME will point to main.
+ Accept this but print the new frame. */
+ if (saved_level != 0)
+ print_stack_frame (get_selected_frame (), -1, 0);
}
+void
+_initialize_blockframe (void)
+{
+ add_setshow_boolean_cmd ("backtrace-below-main", class_obscure,
+ &backtrace_below_main,
+ "Set whether backtraces should continue past \"main\".\n"
+ "Normally the caller of \"main\" is not of interest, so GDB will terminate\n"
+ "the backtrace at \"main\". Set this variable if you need to see the rest\n"
+ "of the stack trace.",
+ "Show whether backtraces should continue past \"main\".\n"
+ "Normally the caller of \"main\" is not of interest, so GDB will terminate\n"
+ "the backtrace at \"main\". Set this variable if you need to see the rest\n"
+ "of the stack trace.",
+ do_flush_frames_sfunc, NULL, &setlist, &showlist);
+}
/* mvs_check FRAME_CHAIN */
#define FRAME_CHAIN(fi) m32r_frame_chain (fi)
-#define FRAME_CHAIN_VALID(fp, frame) generic_file_frame_chain_valid (fp, frame)
-
extern CORE_ADDR m32r_find_callers_reg (struct frame_info *fi, int regnum);
extern CORE_ADDR m32r_frame_saved_pc (struct frame_info *);
/* mvs_check FRAME_SAVED_PC */
/* Parameters for execution on Apollo 68k running BSD.
- Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1998
+ Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1998, 2003
Free Software Foundation, Inc.
Contributed by Cygnus Support.
#include "m68k/tm-m68k.h"
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
-
/* These are the jmp_buf registers I could guess. There are 13 registers
* in the buffer. There are 8 data registers, 6 general address registers,
* the Frame Pointer, the Stack Pointer, the PC and the SR in the chip. I would
/* Target definitions for GDB on a Motorola 680x0 running SVR4.
(Commodore Amiga with amix or Atari TT with ASV)
- Copyright 1991, 1994, 1995, 1996, 1998, 1999, 2000
+ Copyright 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support (fnf@cygint)
#define DECR_PC_AFTER_BREAK 0 /* No decrement required */
-/* Use the alternate method of determining valid frame chains. */
-
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
#include "config/tm-sysv4.h"
#include "m68k/tm-m68k.h"
/* Target machine definitions for a generic m68k monitor/emulator.
- Copyright 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1998, 1999
+ Copyright 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1998, 1999, 2003
Free Software Foundation, Inc.
This file is part of GDB.
#include "m68k/tm-m68k.h"
-/* Need to do this for ELF targets, where we can't figure out the boundaries of
- the entry file. This method stops the backtrace when we reach main. */
-
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
/* FIXME, should do GET_LONGJMP_TARGET for newlib. */
/* Parameters for execution on VxWorks m68k's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1998, 2003 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
#undef FRAME_CHAIN
#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0)
-
-/* If the chain pointer is zero (either because the saved value fetched
- by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN
- never fetched anything), we are at the top of the stack. */
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#undef FRAME_CHAIN_VALID
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
/* Target machine description for VxWorks m68k's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000,
+ 2002, 2003
Free Software Foundation, Inc.
Contributed by Cygnus Support.
#undef FRAME_CHAIN
#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0)
-/* If the chain pointer is zero (either because the saved value fetched
- by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN
- never fetched anything), we are at the top of the stack. */
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#undef FRAME_CHAIN_VALID
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
-
/* FIXME, Longjmp information stolen from Sun-3 config. Dunno if right. */
/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least
documented in a comment in <machine/setjmp.h>! */
/* Parameters for execution on a Matsushita mn10200 processor.
- Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
Contributed by Geoffrey Noer <noer@cygnus.com>
extern CORE_ADDR mn10200_frame_chain (struct frame_info *);
#define FRAME_CHAIN(fi) mn10200_frame_chain (fi)
-#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
extern CORE_ADDR mn10200_find_callers_reg (struct frame_info *, int);
extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *);
/* Macro definitions for GDB for a Fujitsu SPARClite.
- Copyright 1993, 1994, 1995, 1998, 1999, 2000
+ Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
* The following defines must go away for MULTI_ARCH.
*/
-#undef FRAME_CHAIN_VALID
-#define FRAME_CHAIN_VALID(FP,FI) func_frame_chain_valid (FP, FI)
-
#undef NUM_REGS
#define NUM_REGS 80
/* Target dependent code for CRIS, for GDB, the GNU debugger.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hendrik Ruijter, Stefan Andersson, and Orjan Friberg.
set_gdbarch_frameless_function_invocation
(gdbarch, cris_frameless_function_invocation);
set_gdbarch_frame_chain (gdbarch, cris_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, cris_frame_saved_pc);
set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
/* Target-dependent code for Mitsubishi D10V, for GDB.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This file is part of GDB.
static int
d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame)
{
- if (chain != 0 && frame != NULL)
- {
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return 1; /* Path back from a call dummy must be valid. */
- return (get_frame_pc (frame) > IMEM_START
- && !inside_main_func (get_frame_pc (frame)));
- }
- else return 0;
+ return (get_frame_pc (frame) > IMEM_START);
}
static CORE_ADDR
/* Cache and manage frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
main. */
id.base = FRAME_CHAIN (next_frame);
- /* FIXME: cagney/2002-06-08: There should be two tests here.
- The first would check for a valid frame chain based on a user
- selectable policy. The default being ``stop at main'' (as
- implemented by generic_func_frame_chain_valid()). Other
- policies would be available - stop at NULL, .... The second
- test, if provided by the target architecture, would check for
- more exotic cases - most target architectures wouldn't bother
- with this second case. */
- if (!FRAME_CHAIN_VALID (id.base, next_frame))
+ if (!frame_chain_valid (id.base, next_frame))
return null_frame_id;
}
if (id.base == 0)
main. */
address = FRAME_CHAIN (next_frame);
- /* FIXME: cagney/2002-06-08: There should be two tests here.
- The first would check for a valid frame chain based on a user
- selectable policy. The default being ``stop at main'' (as
- implemented by generic_func_frame_chain_valid()). Other
- policies would be available - stop at NULL, .... The second
- test, if provided by the target architecture, would check for
- more exotic cases - most target architectures wouldn't bother
- with this second case. */
- if (!FRAME_CHAIN_VALID (address, next_frame))
+ if (!frame_chain_valid (address, next_frame))
return 0;
}
if (address == 0)
/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
extern void *frame_obstack_alloc (unsigned long size);
-/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
- targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
- is the outermost one and has no caller.
+/* If FRAME_CHAIN_VALID returns zero it means that the given frame
+ is the outermost one and has no caller. */
- XXXX - both default and alternate frame_chain_valid functions are
- deprecated. New code should use dummy frames and one of the
- generic functions. */
+extern int frame_chain_valid (CORE_ADDR, struct frame_info *);
-extern int file_frame_chain_valid (CORE_ADDR, struct frame_info *);
-extern int func_frame_chain_valid (CORE_ADDR, struct frame_info *);
-extern int nonnull_frame_chain_valid (CORE_ADDR, struct frame_info *);
-extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *);
-extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *);
extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
-
#ifdef FRAME_FIND_SAVED_REGS
/* XXX - deprecated */
#define FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL)
set_gdbarch_saved_pc_after_call (gdbarch, frv_saved_pc_after_call);
set_gdbarch_frame_chain (gdbarch, frv_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, frv_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs);
current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
current_gdbarch->frame_args_skip = -1;
current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
- current_gdbarch->frame_chain_valid = generic_func_frame_chain_valid;
current_gdbarch->frame_args_address = get_frame_base;
current_gdbarch->frame_locals_address = get_frame_base;
current_gdbarch->extra_stack_alignment_needed = 1;
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->frame_chain == 0))
fprintf_unfiltered (log, "\n\tframe_chain");
- /* Skip verify of frame_chain_valid, invalid_p == 0 */
+ /* Skip verify of frame_chain_valid, has predicate */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->frame_saved_pc == 0))
fprintf_unfiltered (log, "\n\tframe_saved_pc");
(long) current_gdbarch->frame_chain
/*FRAME_CHAIN ()*/);
#endif
+#ifdef FRAME_CHAIN_VALID_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAME_CHAIN_VALID_P()",
+ XSTRING (FRAME_CHAIN_VALID_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_CHAIN_VALID_P() = %d\n",
+ FRAME_CHAIN_VALID_P ());
+#endif
#ifdef FRAME_CHAIN_VALID
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
gdbarch->frame_chain = frame_chain;
}
+int
+gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->frame_chain_valid != 0;
+}
+
int
gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
{
#endif
#endif
-/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for
- most targets. If FRAME_CHAIN_VALID returns zero it means that the
- given frame is the outermost one and has no caller.
-
- XXXX - both default and alternate frame_chain_valid functions are
- deprecated. New code should use dummy frames and one of the generic
- functions. */
+#if defined (FRAME_CHAIN_VALID)
+/* Legacy for systems yet to multi-arch FRAME_CHAIN_VALID */
+#if !defined (FRAME_CHAIN_VALID_P)
+#define FRAME_CHAIN_VALID_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID_P)
+#define FRAME_CHAIN_VALID_P() (0)
+#endif
+
+extern int gdbarch_frame_chain_valid_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID_P)
+#error "Non multi-arch definition of FRAME_CHAIN_VALID"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID_P)
+#define FRAME_CHAIN_VALID_P() (gdbarch_frame_chain_valid_p (current_gdbarch))
+#endif
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
-#define FRAME_CHAIN_VALID(chain, thisframe) (generic_func_frame_chain_valid (chain, thisframe))
+#define FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "FRAME_CHAIN_VALID"), 0)
#endif
typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
-# Define a default FRAME_CHAIN_VALID, in the form that is suitable for
-# most targets. If FRAME_CHAIN_VALID returns zero it means that the
-# given frame is the outermost one and has no caller.
-#
-# XXXX - both default and alternate frame_chain_valid functions are
-# deprecated. New code should use dummy frames and one of the generic
-# functions.
-f:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe:::generic_func_frame_chain_valid::0
+F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0
f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0
f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0
set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call);
set_gdbarch_frame_saved_pc (gdbarch, h8300_frame_saved_pc);
set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frame_args_address (gdbarch, h8300_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, h8300_frame_locals_address);
struct unwind_table_entry *u, *next_u = NULL;
struct frame_info *next;
- if (!chain)
- return 0;
-
u = find_unwind_entry (thisframe->pc);
if (u == NULL)
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
- /* FIXME: kettenis/20020511: Why do we override this function here? */
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
-
set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp);
tdep->sigcontext_addr = i386_svr4_sigcontext_addr;
tdep->sc_pc_offset = 14 * 4;
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- /* FIXME: kettenis/20020511: Why do we override this function here? */
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
-
tdep->jb_pc_offset = 24;
}
\f
set_gdbarch_frameless_function_invocation (gdbarch,
i386_frameless_function_invocation);
set_gdbarch_frame_chain (gdbarch, i386_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, i386_frame_saved_pc);
set_gdbarch_saved_pc_after_call (gdbarch, i386_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, i386_frame_num_args);
/* Target-dependent code for the IA-64 for GDB, the GNU debugger.
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call);
set_gdbarch_frame_chain (gdbarch, ia64_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs);
/* Target-dependent code for Motorola 68HC11 & 68HC12
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Stephane Carrez, stcarrez@nerim.fr
This file is part of GDB.
set_gdbarch_frame_chain (gdbarch, m68hc11_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc);
set_gdbarch_frame_args_address (gdbarch, m68hc11_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, m68hc11_frame_locals_address);
set_gdbarch_saved_pc_after_call (gdbarch, m68hc11_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
/* Target dependent code for the Motorola 68000 series.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
+ 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_deprecated_store_return_value (gdbarch, m68k_store_return_value);
set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
set_gdbarch_frameless_function_invocation (gdbarch,
/* Target-machine dependent code for Motorola MCore for GDB, the GNU debugger
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info);
set_gdbarch_frame_chain (gdbarch, mcore_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs);
set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc);
set_gdbarch_deprecated_store_return_value (gdbarch, mcore_store_return_value);
mips_register_convert_to_raw);
set_gdbarch_frame_chain (gdbarch, mips_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frameless_function_invocation (gdbarch,
generic_frameless_function_invocation_not);
set_gdbarch_frame_saved_pc (gdbarch, mips_frame_saved_pc);
/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This file is part of GDB.
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Stack unwinding. */
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call);
set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info);
set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
generic_frameless_function_invocation_not);
set_gdbarch_frame_chain (gdbarch, ns32k_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, ns32k_frame_saved_pc);
set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address);
ppcnbsd_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
- /* Stop at main. */
- set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
-
set_gdbarch_pc_in_sigtramp (gdbarch, ppcnbsd_pc_in_sigtramp);
set_solib_svr4_fetch_link_map_offsets (gdbarch,
set_gdbarch_use_struct_convention (gdbarch,
generic_use_struct_convention);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
-
set_gdbarch_frameless_function_invocation (gdbarch,
rs6000_frameless_function_invocation);
set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain);
set_gdbarch_cannot_fetch_register (gdbarch, s390_cannot_fetch_register);
set_gdbarch_cannot_store_register (gdbarch, s390_cannot_fetch_register);
set_gdbarch_use_struct_convention (gdbarch, s390_use_struct_convention);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_register_name (gdbarch, s390_register_name);
set_gdbarch_stab_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, sh_frame_saved_pc);
set_gdbarch_saved_pc_after_call (gdbarch, sh_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
{
case bfd_mach_sparc:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
break;
case bfd_mach_sparc_sparclet:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparclet_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclet_register_name);
break;
case bfd_mach_sparc_sparclite:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 80);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclite_register_name);
break;
case bfd_mach_sparc_v8plus:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
break;
case bfd_mach_sparc_v8plusa:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
break;
case bfd_mach_sparc_sparclite_le:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 80);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclite_register_name);
break;
case bfd_mach_sparc_v9:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 125);
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
break;
case bfd_mach_sparc_v9a:
set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 125);
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
set_gdbarch_saved_pc_after_call (gdbarch, v850_saved_pc_after_call);
set_gdbarch_frame_saved_pc (gdbarch, v850_frame_saved_pc);
set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue);
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
/*
* Miscelany
generic_frameless_function_invocation_not);
set_gdbarch_frame_chain (gdbarch, vax_frame_chain);
- set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, vax_frame_saved_pc);
set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address);
/* Target-dependent code for the x86-64 for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
set_gdbarch_frame_chain (gdbarch, x86_64_linux_frame_chain);
set_gdbarch_frameless_function_invocation (gdbarch,
x86_64_frameless_function_invocation);
- /* FIXME: kettenis/20021025: Shouldn't this be set to
- generic_file_frame_chain_valid? */
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
/* FIXME: kettenis/20021026: These two are GNU/Linux-specific and
should be moved elsewhere. */
set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);