2002-12-08 Andrew Cagney <ac131313@redhat.com>

* gdbarch.sh (INIT_FRAME_PC_FIRST, INIT_FRAME_PC_DEFAULT): Convert
	to pure functions.
	* gdbarch.h, gdbarch.c: Re-generate.
	* frame.c (get_prev_frame): Explictly assign prev's pc with value
	returned by INIT_FRAME_PC_FIRST and INIT_EXTRA_FRAME_INFO.

	* arch-utils.h (init_frame_pc_default, init_frame_pc_noop): Change
	declaration to a function returning a CORE_ADDR.
	* x86-64-tdep.h (x86_64_init_frame_pc): Ditto.
	* arch-utils.c (init_frame_pc_noop): Return the PC value.
	(init_frame_pc_default): Ditto.
	* x86-64-linux-tdep.c (x86_64_init_frame_pc): Ditto.
	* s390-tdep.c (s390_init_frame_pc_first): Ditto.
	* mips-tdep.c (mips_init_frame_pc_first): Ditto.
	* dwarf2cfi.h (cfi_init_frame_pc): Ditto.
	* dwarf2cfi.c (cfi_init_frame_pc): Ditto.
	* alpha-tdep.c (alpha_init_frame_pc_first): Ditto.

	* i386-interix-tdep.c (i386_interix_init_abi): Set init_frame_pc
	to init_frame_pc_noop.
	(i386_interix_init_frame_pc): Delete function.
	* z8k-tdep.c (init_frame_pc): Delete function.
	* config/z8k/tm-z8k.h (INIT_FRAME_PC): Define as init_frame_pc_noop.
	(INIT_FRAME_PC_FIRST): Ditto.
	* config/mn10200/tm-mn10200.h (INIT_FRAME_PC): Ditto.
	(INIT_FRAME_PC_FIRST): Ditto.
	* config/sparc/tm-sparc.h (INIT_FRAME_PC): Ditto.
	* config/rs6000/tm-rs6000.h (INIT_FRAME_PC): Redefine as
	init_frame_pc_noop.
	(INIT_FRAME_PC_FIRST): Convert to an expression.
	* config/sparc/tm-sparc.h (INIT_FRAME_PC_FIRST): Ditto.
This commit is contained in:
Andrew Cagney 2002-12-09 02:04:17 +00:00
parent 8b36eed86d
commit 97f4695394
20 changed files with 98 additions and 75 deletions

View file

@ -1,3 +1,37 @@
2002-12-08 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (INIT_FRAME_PC_FIRST, INIT_FRAME_PC_DEFAULT): Convert
to pure functions.
* gdbarch.h, gdbarch.c: Re-generate.
* frame.c (get_prev_frame): Explictly assign prev's pc with value
returned by INIT_FRAME_PC_FIRST and INIT_EXTRA_FRAME_INFO.
* arch-utils.h (init_frame_pc_default, init_frame_pc_noop): Change
declaration to a function returning a CORE_ADDR.
* x86-64-tdep.h (x86_64_init_frame_pc): Ditto.
* arch-utils.c (init_frame_pc_noop): Return the PC value.
(init_frame_pc_default): Ditto.
* x86-64-linux-tdep.c (x86_64_init_frame_pc): Ditto.
* s390-tdep.c (s390_init_frame_pc_first): Ditto.
* mips-tdep.c (mips_init_frame_pc_first): Ditto.
* dwarf2cfi.h (cfi_init_frame_pc): Ditto.
* dwarf2cfi.c (cfi_init_frame_pc): Ditto.
* alpha-tdep.c (alpha_init_frame_pc_first): Ditto.
* i386-interix-tdep.c (i386_interix_init_abi): Set init_frame_pc
to init_frame_pc_noop.
(i386_interix_init_frame_pc): Delete function.
* z8k-tdep.c (init_frame_pc): Delete function.
* config/z8k/tm-z8k.h (INIT_FRAME_PC): Define as init_frame_pc_noop.
(INIT_FRAME_PC_FIRST): Ditto.
* config/mn10200/tm-mn10200.h (INIT_FRAME_PC): Ditto.
(INIT_FRAME_PC_FIRST): Ditto.
* config/sparc/tm-sparc.h (INIT_FRAME_PC): Ditto.
* config/rs6000/tm-rs6000.h (INIT_FRAME_PC): Redefine as
init_frame_pc_noop.
(INIT_FRAME_PC_FIRST): Convert to an expression.
* config/sparc/tm-sparc.h (INIT_FRAME_PC_FIRST): Ditto.
2002-12-08 Andrew Cagney <ac131313@redhat.com> 2002-12-08 Andrew Cagney <ac131313@redhat.com>
* blockframe.c: Use get_frame_base instead of directly accessing * blockframe.c: Use get_frame_base instead of directly accessing

View file

@ -456,11 +456,12 @@ alpha_frame_init_saved_regs (struct frame_info *fi)
fi->saved_regs[SP_REGNUM] = fi->frame; fi->saved_regs[SP_REGNUM] = fi->frame;
} }
static void static CORE_ADDR
alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev) alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev)
{ {
prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : return (fromleaf ? SAVED_PC_AFTER_CALL (get_next_frame (prev))
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); : get_next_frame (prev) ? FRAME_SAVED_PC (prev->next)
: read_pc ());
} }
static CORE_ADDR static CORE_ADDR

View file

@ -373,21 +373,22 @@ generic_prepare_to_proceed (int select_it)
} }
void CORE_ADDR
init_frame_pc_noop (int fromleaf, struct frame_info *prev) init_frame_pc_noop (int fromleaf, struct frame_info *prev)
{ {
return; /* Do nothing, implies return the same PC value. */
return get_frame_pc (prev);
} }
void CORE_ADDR
init_frame_pc_default (int fromleaf, struct frame_info *prev) init_frame_pc_default (int fromleaf, struct frame_info *prev)
{ {
if (fromleaf) if (fromleaf)
prev->pc = SAVED_PC_AFTER_CALL (get_next_frame (prev)); return SAVED_PC_AFTER_CALL (get_next_frame (prev));
else if (get_next_frame (prev) != NULL) else if (get_next_frame (prev) != NULL)
prev->pc = FRAME_SAVED_PC (get_next_frame (prev)); return FRAME_SAVED_PC (get_next_frame (prev));
else else
prev->pc = read_pc (); return read_pc ();
} }
void void

View file

@ -117,9 +117,9 @@ extern int generic_prepare_to_proceed (int select_it);
/* Versions of init_frame_pc(). Do nothing; do the default. */ /* Versions of init_frame_pc(). Do nothing; do the default. */
void init_frame_pc_noop (int fromleaf, struct frame_info *prev); extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
void init_frame_pc_default (int fromleaf, struct frame_info *prev); extern CORE_ADDR init_frame_pc_default (int fromleaf, struct frame_info *prev);
/* Do nothing version of elf_make_msymbol_special. */ /* Do nothing version of elf_make_msymbol_special. */

View file

@ -107,7 +107,8 @@ struct value;
extern void mn10200_init_extra_frame_info (struct frame_info *); extern void mn10200_init_extra_frame_info (struct frame_info *);
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10200_init_extra_frame_info (fi) #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10200_init_extra_frame_info (fi)
#define INIT_FRAME_PC(x,y) #define INIT_FRAME_PC(x,y) (init_frame_pc_noop (x, y))
#define INIT_FRAME_PC_FIRST(x,y) (init_frame_pc_noop (x, y))
extern void mn10200_frame_find_saved_regs (struct frame_info *, extern void mn10200_frame_find_saved_regs (struct frame_info *,
struct frame_saved_regs *); struct frame_saved_regs *);

View file

@ -79,9 +79,9 @@ extern void aix_process_linenos (void);
/* Define other aspects of the stack frame. */ /* Define other aspects of the stack frame. */
#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \ #define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \
prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ())
#define INIT_FRAME_PC(fromleaf, prev) /* nothing */ #define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
/* Flag for machine-specific stuff in shared files. FIXME */ /* Flag for machine-specific stuff in shared files. FIXME */
#define IBM6000_TARGET #define IBM6000_TARGET

View file

@ -519,10 +519,10 @@ extern void sparc_print_extra_frame_info (struct frame_info *);
/* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */ /* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */
#define INIT_FRAME_PC(FROMLEAF, PREV) /* nothing */ #define INIT_FRAME_PC(FROMLEAF, PREV) (init_frame_pc_noop (FROMLEAF, PREV))
#define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \ #define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
(PREV)->pc = ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \ ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \
(PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ()); (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ())
/* Define other aspects of the stack frame. */ /* Define other aspects of the stack frame. */

View file

@ -108,9 +108,8 @@ extern int z8k_saved_pc_after_call (struct frame_info *frame);
#define REGISTER_VIRTUAL_TYPE(N) \ #define REGISTER_VIRTUAL_TYPE(N) \
(REGISTER_VIRTUAL_SIZE(N) == 2? builtin_type_unsigned_int : builtin_type_long) (REGISTER_VIRTUAL_SIZE(N) == 2? builtin_type_unsigned_int : builtin_type_long)
/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y) */ #define INIT_FRAME_PC(x,y) (init_frame_pc_noop (x, y))
/* Initializer for an array of names of registers. #define INIT_FRAME_PC_FIRST(x,y) (init_frame_pc_noop (x, y))
Entries beyond the first NUM_REGS are ignored. */
#define REGISTER_NAMES \ #define REGISTER_NAMES \
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \

View file

@ -1746,13 +1746,19 @@ cfi_frame_chain (struct frame_info *fi)
} }
/* Sets the pc of the frame. */ /* Sets the pc of the frame. */
void CORE_ADDR
cfi_init_frame_pc (int fromleaf, struct frame_info *fi) cfi_init_frame_pc (int fromleaf, struct frame_info *fi)
{ {
if (fi->next) if (get_next_frame (fi))
get_reg ((char *) &(fi->pc), UNWIND_CONTEXT (fi->next), PC_REGNUM); {
CORE_ADDR pc;
/* FIXME: cagney/2002-12-04: This is straight wrong. It's
assuming that the PC is CORE_ADDR (a host quantity) in size. */
get_reg (&pc, UNWIND_CONTEXT (get_next_frame (fi)), PC_REGNUM);
return pc;
}
else else
fi->pc = read_pc (); return read_pc ();
} }
/* Initialize unwind context informations of the frame. */ /* Initialize unwind context informations of the frame. */

View file

@ -67,7 +67,7 @@ void cfi_pop_frame (struct frame_info *);
CORE_ADDR cfi_frame_chain (struct frame_info *fi); CORE_ADDR cfi_frame_chain (struct frame_info *fi);
/* Sets the pc of the frame. */ /* Sets the pc of the frame. */
void cfi_init_frame_pc (int fromleaf, struct frame_info *fi); CORE_ADDR cfi_init_frame_pc (int fromleaf, struct frame_info *fi);
/* Initialize unwind context informations of the frame. */ /* Initialize unwind context informations of the frame. */
void cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi); void cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi);

View file

@ -1042,7 +1042,7 @@ get_prev_frame (struct frame_info *next_frame)
function does have somewhere to cache that PC value. */ function does have somewhere to cache that PC value. */
if (DEPRECATED_INIT_FRAME_PC_FIRST_P ()) if (DEPRECATED_INIT_FRAME_PC_FIRST_P ())
DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev); prev->pc = (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev));
if (INIT_EXTRA_FRAME_INFO_P ()) if (INIT_EXTRA_FRAME_INFO_P ())
INIT_EXTRA_FRAME_INFO (fromleaf, prev); INIT_EXTRA_FRAME_INFO (fromleaf, prev);
@ -1050,7 +1050,7 @@ get_prev_frame (struct frame_info *next_frame)
/* This entry is in the frame queue now, which is good since /* This entry is in the frame queue now, which is good since
FRAME_SAVED_PC may use that queue to figure out its value (see FRAME_SAVED_PC may use that queue to figure out its value (see
tm-sparc.h). We want the pc saved in the inferior frame. */ tm-sparc.h). We want the pc saved in the inferior frame. */
INIT_FRAME_PC (fromleaf, prev); prev->pc = (INIT_FRAME_PC (fromleaf, prev));
/* If ->frame and ->pc are unchanged, we are in the process of /* If ->frame and ->pc are unchanged, we are in the process of
getting ourselves into an infinite backtrace. Some architectures getting ourselves into an infinite backtrace. Some architectures

View file

@ -1202,13 +1202,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_INIT_FRAME_PC_FIRST_P ()); DEPRECATED_INIT_FRAME_PC_FIRST_P ());
#endif #endif
#ifdef DEPRECATED_INIT_FRAME_PC_FIRST #ifdef DEPRECATED_INIT_FRAME_PC_FIRST
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n", "gdbarch_dump: %s # %s\n",
"DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)", "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev))); XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
#endif
if (GDB_MULTI_ARCH) if (GDB_MULTI_ARCH)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = 0x%08lx\n", "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = 0x%08lx\n",
@ -1581,13 +1578,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
/*INIT_EXTRA_FRAME_INFO ()*/); /*INIT_EXTRA_FRAME_INFO ()*/);
#endif #endif
#ifdef INIT_FRAME_PC #ifdef INIT_FRAME_PC
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n", "gdbarch_dump: %s # %s\n",
"INIT_FRAME_PC(fromleaf, prev)", "INIT_FRAME_PC(fromleaf, prev)",
XSTRING (INIT_FRAME_PC (fromleaf, prev))); XSTRING (INIT_FRAME_PC (fromleaf, prev)));
#endif
if (GDB_MULTI_ARCH) if (GDB_MULTI_ARCH)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n", "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
@ -3791,7 +3785,7 @@ gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch)
return gdbarch->deprecated_init_frame_pc_first != 0; return gdbarch->deprecated_init_frame_pc_first != 0;
} }
void CORE_ADDR
gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{ {
gdb_assert (gdbarch != NULL); gdb_assert (gdbarch != NULL);
@ -3800,7 +3794,7 @@ gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, s
"gdbarch: gdbarch_deprecated_init_frame_pc_first invalid"); "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid");
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n"); fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n");
gdbarch->deprecated_init_frame_pc_first (fromleaf, prev); return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev);
} }
void void
@ -3810,7 +3804,7 @@ set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first; gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first;
} }
void CORE_ADDR
gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{ {
gdb_assert (gdbarch != NULL); gdb_assert (gdbarch != NULL);
@ -3819,7 +3813,7 @@ gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info
"gdbarch: gdbarch_init_frame_pc invalid"); "gdbarch: gdbarch_init_frame_pc invalid");
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n"); fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n");
gdbarch->init_frame_pc (fromleaf, prev); return gdbarch->init_frame_pc (fromleaf, prev);
} }
void void

View file

@ -1203,8 +1203,8 @@ extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0) #define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0)
#endif #endif
typedef void (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
extern void gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first); extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST) #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST)
#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
@ -1220,8 +1220,8 @@ extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev)) #define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
#endif #endif
typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); typedef CORE_ADDR (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); extern CORE_ADDR gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc); extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC) #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC)
#error "Non multi-arch definition of INIT_FRAME_PC" #error "Non multi-arch definition of INIT_FRAME_PC"

View file

@ -513,8 +513,8 @@ v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_
v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx
v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P
f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0 f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
F::DEPRECATED_INIT_FRAME_PC_FIRST:void:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0 f:2:INIT_FRAME_PC:CORE_ADDR:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0
# #
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::

View file

@ -117,12 +117,6 @@ i386_interix_skip_trampoline_code (CORE_ADDR pc)
return i386_pe_skip_trampoline_code (pc, 0); return i386_pe_skip_trampoline_code (pc, 0);
} }
static void
i386_interix_init_frame_pc (int fromleaf, struct frame_info *prev)
{
/* Nothing to do on Interix. */
}
static int static int
i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{ {
@ -337,7 +331,7 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_skip_trampoline_code (gdbarch, set_gdbarch_skip_trampoline_code (gdbarch,
i386_interix_skip_trampoline_code); i386_interix_skip_trampoline_code);
set_gdbarch_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); set_gdbarch_init_extra_frame_info (gdbarch, i386_interix_back_one_frame);
set_gdbarch_init_frame_pc (gdbarch, i386_interix_init_frame_pc); set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc); set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc);
set_gdbarch_name_of_malloc (gdbarch, "_malloc"); set_gdbarch_name_of_malloc (gdbarch, "_malloc");

View file

@ -1677,7 +1677,7 @@ mips_software_single_step (enum target_signal sig, int insert_breakpoints_p)
target_remove_breakpoint (next_pc, break_mem); target_remove_breakpoint (next_pc, break_mem);
} }
static void static CORE_ADDR
mips_init_frame_pc_first (int fromleaf, struct frame_info *prev) mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
{ {
CORE_ADDR pc, tmp; CORE_ADDR pc, tmp;
@ -1685,7 +1685,7 @@ mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) : pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) :
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
tmp = SKIP_TRAMPOLINE_CODE (pc); tmp = SKIP_TRAMPOLINE_CODE (pc);
prev->pc = tmp ? tmp : pc; return tmp ? tmp : pc;
} }

View file

@ -881,25 +881,24 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
for the moment. for the moment.
For some reason the blockframe.c calls us with fi->next->fromleaf For some reason the blockframe.c calls us with fi->next->fromleaf
so this seems of little use to us. */ so this seems of little use to us. */
void CORE_ADDR
s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi) s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi)
{ {
CORE_ADDR sigcaller_pc; CORE_ADDR sigcaller_pc;
CORE_ADDR pc = 0;
fi->pc = 0;
if (next_fromleaf) if (next_fromleaf)
{ {
fi->pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM)); pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
/* fix signal handlers */ /* fix signal handlers */
} }
else if (fi->next && fi->next->pc) else if (get_next_frame (fi) && get_frame_pc (get_next_frame (fi)))
fi->pc = s390_frame_saved_pc_nofix (fi->next); pc = s390_frame_saved_pc_nofix (get_next_frame (fi));
if (fi->pc && fi->next && fi->next->frame && if (pc && get_next_frame (fi) && get_frame_base (get_next_frame (fi))
s390_is_sigreturn (fi->pc, fi->next, NULL, &sigcaller_pc)) && s390_is_sigreturn (pc, get_next_frame (fi), NULL, &sigcaller_pc))
{ {
fi->pc = sigcaller_pc; pc = sigcaller_pc;
} }
return pc;
} }
void void

View file

@ -175,17 +175,17 @@ x86_64_linux_frame_chain (struct frame_info *fi)
return fp; return fp;
} }
void CORE_ADDR
x86_64_init_frame_pc (int fromleaf, struct frame_info *fi) x86_64_init_frame_pc (int fromleaf, struct frame_info *fi)
{ {
CORE_ADDR addr; CORE_ADDR addr;
if (fi->next && (get_frame_type (fi->next) == SIGTRAMP_FRAME)) if (get_next_frame (fi) && (get_frame_type (fi->next) == SIGTRAMP_FRAME))
{ {
addr = fi->next->next->frame addr = get_frame_base (get_next_frame (get_next_frame (fi)))
+ LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
fi->pc = read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8);
} }
else else
cfi_init_frame_pc (fromleaf, fi); return cfi_init_frame_pc (fromleaf, fi);
} }

View file

@ -35,7 +35,7 @@ gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call; gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp; gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp;
CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi); CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi);
void x86_64_init_frame_pc (int fromleaf, struct frame_info *fi); CORE_ADDR x86_64_init_frame_pc (int fromleaf, struct frame_info *fi);
#endif #endif

View file

@ -166,12 +166,6 @@ z8k_frame_chain (struct frame_info *thisframe)
return 0; return 0;
} }
void
init_frame_pc (void)
{
internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Put here the code to store, into a struct frame_saved_regs, /* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO. the addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special This includes special registers such as pc and fp saved in special