From 97f46953947f21e2b8f1cac99546b7d6b51a84cc Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 9 Dec 2002 02:04:17 +0000 Subject: 2002-12-08 Andrew Cagney * 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. --- gdb/dwarf2cfi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gdb/dwarf2cfi.c') diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 30c2db7..c431862 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -1746,13 +1746,19 @@ cfi_frame_chain (struct frame_info *fi) } /* Sets the pc of the frame. */ -void +CORE_ADDR cfi_init_frame_pc (int fromleaf, struct frame_info *fi) { - if (fi->next) - get_reg ((char *) &(fi->pc), UNWIND_CONTEXT (fi->next), PC_REGNUM); + if (get_next_frame (fi)) + { + 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 - fi->pc = read_pc (); + return read_pc (); } /* Initialize unwind context informations of the frame. */ -- cgit v1.1