From ae45cd16823c7f6d380b2184fca4bbfa79ec559f Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 1 Dec 2002 19:07:16 +0000 Subject: [PATCH] 2002-12-01 Andrew Cagney * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename PC_IN_CALL_DUMMY. Change to predicate. Always allow call. * gdbarch.h, gdbarch.c: Re-generate. * config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update. * config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update. * config/pa/tm-hppa.h, frame.h: Update. * x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update. * s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update. * m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update. * cris-tdep.c, alpha-tdep.c: Update. * frame.c (set_unwind_by_pc, create_new_frame): Use either DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame. (get_prev_frame): Ditto. Index: doc/ChangeLog 2002-12-01 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete PC_IN_CALL_DUMMY. --- gdb/ChangeLog | 16 ++++++++++ gdb/alpha-tdep.c | 4 +-- gdb/arm-tdep.c | 20 ++++++------ gdb/avr-tdep.c | 8 ++--- gdb/blockframe.c | 10 +++--- gdb/breakpoint.c | 6 ++-- gdb/config/h8500/tm-h8500.h | 2 +- gdb/config/m32r/tm-m32r.h | 2 +- gdb/config/mn10200/tm-mn10200.h | 4 +-- gdb/config/pa/tm-hppa.h | 4 +-- gdb/config/sparc/tm-sp64.h | 8 ++--- gdb/config/sparc/tm-sparc.h | 4 +-- gdb/config/z8k/tm-z8k.h | 2 +- gdb/cris-tdep.c | 8 ++--- gdb/d10v-tdep.c | 12 ++++---- gdb/doc/ChangeLog | 5 +++ gdb/doc/gdbint.texinfo | 4 --- gdb/frame.c | 25 ++++++--------- gdb/frame.h | 42 +++++++++++++------------ gdb/frv-tdep.c | 2 +- gdb/gdbarch.c | 54 +++++++++++++++++++-------------- gdb/gdbarch.h | 44 +++++++++++++++++++++------ gdb/gdbarch.sh | 41 ++++++++++++++++--------- gdb/h8300-tdep.c | 10 +++--- gdb/i386-tdep.c | 6 ++-- gdb/ia64-tdep.c | 10 +++--- gdb/inferior.h | 2 +- gdb/infrun.c | 4 +-- gdb/m32r-tdep.c | 12 ++++---- gdb/m68hc11-tdep.c | 4 +-- gdb/m68k-tdep.c | 2 +- gdb/mcore-tdep.c | 8 ++--- gdb/mips-tdep.c | 12 ++++---- gdb/mn10200-tdep.c | 2 +- gdb/mn10300-tdep.c | 2 +- gdb/ns32k-tdep.c | 2 +- gdb/rs6000-tdep.c | 8 ++--- gdb/s390-tdep.c | 2 +- gdb/sh-tdep.c | 18 +++++------ gdb/sparc-tdep.c | 8 ++--- gdb/v850-tdep.c | 10 +++--- gdb/vax-tdep.c | 2 +- gdb/x86-64-tdep.c | 2 +- gdb/xstormy16-tdep.c | 8 ++--- 44 files changed, 261 insertions(+), 200 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d27c6260c0a..7479c44d0ab 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +2002-12-01 Andrew Cagney + + * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename + PC_IN_CALL_DUMMY. Change to predicate. Always allow call. + * gdbarch.h, gdbarch.c: Re-generate. + * config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update. + * config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update. + * config/pa/tm-hppa.h, frame.h: Update. + * x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update. + * s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update. + * m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update. + * cris-tdep.c, alpha-tdep.c: Update. + * frame.c (set_unwind_by_pc, create_new_frame): Use either + DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame. + (get_prev_frame): Ditto. + 2002-11-30 Andrew Cagney * exec.c (xfer_memory): Replace boolean with int. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index ead1d935afd..1f38f682360 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -822,7 +822,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame) So we have to find the proc_desc whose frame is closest to the current stack pointer. */ - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) { struct linked_proc_info *link; CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); @@ -1891,7 +1891,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 742b0d26934..386ab9163bf 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -215,7 +215,7 @@ arm_pc_is_thumb_dummy (CORE_ADDR memaddr) frame location (true if we have not pushed large data structures or gone too many levels deep) and that our 1024 is not enough to consider code regions as part of the stack (true for most practical purposes). */ - if (PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024)) + if (DEPRECATED_PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024)) return caller_is_thumb; else return 0; @@ -410,7 +410,7 @@ arm_skip_prologue (CORE_ADDR pc) struct symtab_and_line sal; /* If we're in a dummy frame, don't even try to skip the prologue. */ - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return pc; /* See what the symbol table says. */ @@ -536,7 +536,7 @@ thumb_scan_prologue (struct frame_info *fi) /* Don't try to scan dummy frames. */ if (fi != NULL - && PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + && DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) return; if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end)) @@ -990,7 +990,7 @@ arm_find_callers_reg (struct frame_info *fi, int regnum) function could be called directly. */ for (; fi; fi = fi->next) { - if (PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) { return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); } @@ -1019,7 +1019,7 @@ arm_frame_chain (struct frame_info *fi) CORE_ADDR caller_pc; int framereg = fi->extra_info->framereg; - if (PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) /* A generic call dummy's frame is the same as caller's. */ return fi->frame; @@ -1102,7 +1102,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) the sigtramp and call dummy cases. */ if (!fi->next) sp = read_sp(); - else if (PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) /* For generic dummy frames, pull the value direct from the frame. Having an unwind function to do this would be nice. */ sp = deprecated_read_register_dummy (fi->next->pc, fi->next->frame, @@ -1150,7 +1150,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (!fi->next) /* This is the innermost frame? */ fi->frame = read_register (fi->extra_info->framereg); - else if (PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) /* Next inner most frame is a dummy, just grab its frame. Dummy frames always have the same FP as their caller. */ fi->frame = fi->next->frame; @@ -1191,10 +1191,10 @@ static CORE_ADDR arm_frame_saved_pc (struct frame_info *fi) { /* If a dummy frame, pull the PC out of the frame's register buffer. */ - if (PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) return deprecated_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset, + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset, fi->frame)) { return read_memory_integer (fi->saved_regs[ARM_PC_REGNUM], @@ -1520,7 +1520,7 @@ arm_pop_frame (void) CORE_ADDR old_SP = (frame->frame - frame->extra_info->frameoffset + frame->extra_info->framesize); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); flush_cached_frames (); diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 688e8c72ca9..45a4f209221 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -750,7 +750,7 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) avr_scan_prologue (fi); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -833,7 +833,7 @@ avr_pop_frame (void) CORE_ADDR saddr; struct frame_info *frame = get_current_frame (); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); } @@ -866,7 +866,7 @@ avr_pop_frame (void) static CORE_ADDR avr_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, AVR_PC_REGNUM); else @@ -1030,7 +1030,7 @@ avr_frame_address (struct frame_info *fi) static CORE_ADDR avr_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { /* initialize the return_pc now */ frame->extra_info->return_pc diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 318d5d4195a..84b8cc48a16 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -92,7 +92,7 @@ inside_entry_file (CORE_ADDR addr) /* Do not stop backtracing if the pc is in the call dummy at the entry point. */ /* FIXME: Won't always work with zeros for the last two arguments */ - if (PC_IN_CALL_DUMMY (addr, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0)) return 0; } return (addr >= symfile_objfile->ei.entry_file_lowpc && @@ -157,7 +157,7 @@ inside_entry_func (CORE_ADDR pc) /* Do not stop backtracing if the pc is in the call dummy at the entry point. */ /* FIXME: Won't always work with zeros for the last two arguments */ - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return 0; } return (symfile_objfile->ei.entry_func_lowpc <= pc && @@ -665,7 +665,7 @@ deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, have that meaning, but the 29k doesn't use ON_STACK. This could be fixed by generalizing this scheme, perhaps by passing in a frame and adding a few fields, at least on machines which need them for - PC_IN_CALL_DUMMY. + DEPRECATED_PC_IN_CALL_DUMMY. Something simpler, like checking for the stack segment, doesn't work, since various programs (threads implementations, gcc nested function @@ -697,7 +697,7 @@ deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, int generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (frame_pc_unwind (fi), fp, fp)) + 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 @@ -709,7 +709,7 @@ int generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY ((fi)->pc, 0, 0)) + && DEPRECATED_PC_IN_CALL_DUMMY ((fi)->pc, 0, 0)) return 1; /* don't prune CALL_DUMMY frames */ else /* fall back to default algorithm (see frame.h) */ return (fp != 0 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index dfe9851162d..eda76c2504d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1683,9 +1683,9 @@ breakpoint_inserted_here_p (CORE_ADDR pc) } /* Return nonzero if FRAME is a dummy frame. We can't use - PC_IN_CALL_DUMMY because figuring out the saved SP would take too - much time, at least using get_saved_register on the 68k. This - means that for this function to work right a port must use the + DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would + take too much time, at least using get_saved_register on the 68k. + This means that for this function to work right a port must use the bp_call_dummy breakpoint. */ int diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index ded1165eef8..4f8f3479d4a 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -25,7 +25,7 @@ /* NOTE: cagney/2002-11-24: This is a guess. */ #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 #define CALL_DUMMY_LOCATION ON_STACK -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Contributed by Steve Chamberlain sac@cygnus.com */ diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index 72e4bce69f3..51c8f7212db 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -191,7 +191,7 @@ extern use_struct_convention_fn m32r_use_struct_convention; /* generic dummy frame stuff */ #define PUSH_DUMMY_FRAME generic_push_dummy_frame () -#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) /* target-specific dummy_frame stuff */ diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index a4794704698..f7760926e4f 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -189,7 +189,7 @@ extern void mn10200_pop_frame (struct frame_info *); #define CALL_DUMMY_START_OFFSET (0) #define CALL_DUMMY_BREAKPOINT_OFFSET (0) #define CALL_DUMMY_LOCATION AT_ENTRY_POINT -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) #define CALL_DUMMY_ADDRESS() entry_point_address () @@ -203,7 +203,7 @@ extern CORE_ADDR mn10200_push_arguments (int, struct value **, CORE_ADDR, #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) -#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) #define REG_STRUCT_HAS_ADDR(gcc_p,TYPE) \ (TYPE_LENGTH (TYPE) > 8) diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 835140f9bc8..5cf60fffcbd 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -29,7 +29,7 @@ /* NOTE: cagney/2002-11-24: This is a guess. */ #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 #define CALL_DUMMY_LOCATION ON_STACK -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Forward declarations of some types we use in prototypes */ @@ -516,7 +516,7 @@ extern void hppa_pop_frame (void); we'll consider that to mean that we've reached the call dummy's end after its successful completion. */ #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ - (PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ + (DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ (read_memory_integer((pc), 4) == BREAKPOINT32)) /* diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 54329f5053e..0c3731f3065 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -100,8 +100,8 @@ #define CALL_DUMMY_BREAKPOINT_OFFSET_P 1 #undef CALL_DUMMY_LOCATION #define CALL_DUMMY_LOCATION AT_ENTRY_POINT -#undef PC_IN_CALL_DUMMY -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) +#undef DEPRECATED_PC_IN_CALL_DUMMY +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) #undef CALL_DUMMY_STACK_ADJUST #define CALL_DUMMY_STACK_ADJUST 128 #undef SIZEOF_CALL_DUMMY_WORDS @@ -170,8 +170,8 @@ sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); /* Call dummy will be located on the stack. */ #undef CALL_DUMMY_LOCATION #define CALL_DUMMY_LOCATION ON_STACK -#undef PC_IN_CALL_DUMMY -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#undef DEPRECATED_PC_IN_CALL_DUMMY +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Insert the function address into the call dummy. */ #undef FIX_CALL_DUMMY diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 0b61761ec3b..7cced22cfb8 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -657,11 +657,11 @@ extern void sparc_print_extra_frame_info (struct frame_info *); /* Call dummy method (eg. on stack, at entry point, etc.) */ #define CALL_DUMMY_LOCATION ON_STACK -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Method for detecting dummy frames. */ -#define PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \ +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \ deprecated_pc_in_call_dummy_on_stack (PC, SP, FRAME_ADDRESS) #endif /* GDB_MULTI_ARCH */ diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index 1a3ff4590aa..1c11d53505b 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -23,7 +23,7 @@ /* NOTE: cagney/2002-11-24: This is a guess. */ #define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 #define CALL_DUMMY_LOCATION ON_STACK -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) #undef TARGET_INT_BIT #undef TARGET_LONG_BIT diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 6cc88ae75ef..35ba2912130 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1213,7 +1213,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info->return_pc = 0; fi->extra_info->leaf_function = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1254,7 +1254,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) CORE_ADDR cris_frame_chain (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { return fi->frame; } @@ -1512,7 +1512,7 @@ cris_pop_frame (void) register int regno; register int stack_offset = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* This happens when we hit a breakpoint set at the entry point, when returning from a dummy frame. */ @@ -4259,7 +4259,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Read all about dummy frames in blockframe.c. */ set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); /* Defined to 1 to indicate that the target supports inferior function calls. */ diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 09492ca08dd..d1fcafc261e 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -114,7 +114,7 @@ d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame) { if (chain != 0 && frame != NULL) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return 1; /* Path back from a call dummy must be valid. */ return ((frame)->pc > IMEM_START && !inside_main_func (frame->pc)); @@ -512,7 +512,7 @@ d10v_extract_struct_value_address (char *regbuf) static CORE_ADDR d10v_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return d10v_make_iaddr (deprecated_read_register_dummy (frame->pc, frame->frame, PC_REGNUM)); @@ -688,7 +688,7 @@ d10v_frame_chain (struct frame_info *fi) CORE_ADDR addr; /* A generic call dummy's frame is the same as caller's. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return fi->frame; d10v_frame_init_saved_regs (fi); @@ -699,7 +699,7 @@ d10v_frame_chain (struct frame_info *fi) { /* This is meant to halt the backtrace at "_start". Make sure we don't halt it at a generic dummy frame. */ - if (!PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0)) + if (!DEPRECATED_PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0)) return (CORE_ADDR) 0; } @@ -911,13 +911,13 @@ d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* If fi->pc is zero, but this is not the outermost frame, then let's snatch the return_pc from the callee, so that - PC_IN_CALL_DUMMY will work. */ + DEPRECATED_PC_IN_CALL_DUMMY will work. */ if (fi->pc == 0 && fi->level != 0 && fi->next != NULL) fi->pc = d10v_frame_saved_pc (fi->next); /* The call dummy doesn't save any registers on the stack, so we can return now. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { return; } diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index eb815c2e20b..a85398e5f78 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2002-12-01 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + PC_IN_CALL_DUMMY. + 2002-11-28 Andrew Cagney * gdbint.texinfo (Host Definition): Delete documentation on diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index c6936b884c6..5aba24ddda8 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3675,10 +3675,6 @@ them. @findex PCC_SOL_BROKEN (Used only in the Convex target.) -@item PC_IN_CALL_DUMMY -@findex PC_IN_CALL_DUMMY -See @file{inferior.h}. - @item PC_IN_SIGTRAMP (@var{pc}, @var{name}) @findex PC_IN_SIGTRAMP @cindex sigtramp diff --git a/gdb/frame.c b/gdb/frame.c index 1ece65b2318..3fd5bb3f502 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -718,11 +718,9 @@ set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp, *unwind_register = frame_saved_regs_register_unwind; *unwind_pc = frame_saved_regs_pc_unwind; } - /* FIXME: cagney/2002-11-24: Can't yet directly call - pc_in_dummy_frame() as some architectures don't set - PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the - latter is implemented by simply calling pc_in_dummy_frame). */ - else if (PC_IN_CALL_DUMMY (pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) + : pc_in_dummy_frame (pc)) { *unwind_register = dummy_frame_register_unwind; *unwind_pc = dummy_frame_pc_unwind; @@ -760,11 +758,10 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) has previously set it. This is really somewhat bogus. The initialization, as seen in create_new_frame(), should occur before the INIT function has been called. */ - /* FIXME: cagney/2002-11-24: Can't yet directly call - pc_in_dummy_frame() as some architectures don't set - PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the - latter is implemented by simply calling pc_in_dummy_frame). */ - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES && PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) + : pc_in_dummy_frame (pc))) /* NOTE: cagney/2002-11-11: Does this even occure? */ type = DUMMY_FRAME; else @@ -1045,12 +1042,10 @@ get_prev_frame (struct frame_info *next_frame) has previously set it. This is really somewhat bogus. The initialization, as seen in create_new_frame(), should occur before the INIT function has been called. */ - /* FIXME: cagney/2002-11-24: Can't yet directly call - pc_in_dummy_frame() as some architectures don't set - PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the - latter is implemented by simply calling pc_in_dummy_frame). */ if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (prev->pc, 0, 0)) + && (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (prev->pc, 0, 0) + : pc_in_dummy_frame (prev->pc))) prev->type = DUMMY_FRAME; else { diff --git a/gdb/frame.h b/gdb/frame.h index 419511c6a40..ab123b32262 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -135,13 +135,13 @@ extern void find_frame_sal (struct frame_info *frame, *FRAME* macros, a frame address has no defined meaning other than as a magic cookie which identifies a frame over calls to the inferior (um, SEE NOTE BELOW). The only known exception is - inferior.h (PC_IN_CALL_DUMMY) [ON_STACK]; see comments there. You - cannot assume that a frame address contains enough information to - reconstruct the frame; if you want more than just to identify the - frame (e.g. be able to fetch variables relative to that frame), - then save the whole struct frame_info (and the next struct - frame_info, since the latter is used for fetching variables on some - machines) (um, again SEE NOTE BELOW). + inferior.h (DEPRECATED_PC_IN_CALL_DUMMY) [ON_STACK]; see comments + there. You cannot assume that a frame address contains enough + information to reconstruct the frame; if you want more than just to + identify the frame (e.g. be able to fetch variables relative to + that frame), then save the whole struct frame_info (and the next + struct frame_info, since the latter is used for fetching variables + on some machines) (um, again SEE NOTE BELOW). NOTE: cagney/2002-11-18: Actually, the frame address isn't sufficient for identifying a frame, and the counter examples are @@ -156,12 +156,13 @@ extern void find_frame_sal (struct frame_info *frame, comparing both the frame's base and the frame's enclosing function (frame_find_by_id() is going to be modified to perform this test). - The generic dummy frame version of PC_IN_CALL_DUMMY() is able to - identify a dummy frame using only the PC value. So the frame - address is not needed. In fact, most PC_IN_CALL_DUMMY() calls now - pass zero as the frame/sp values as the caller knows that those - values won't be used. Once all architectures are using generic - dummy frames, PC_IN_CALL_DUMMY() can drop the sp/frame parameters. + The generic dummy frame version of DEPRECATED_PC_IN_CALL_DUMMY() is + able to identify a dummy frame using only the PC value. So the + frame address is not needed. In fact, most + DEPRECATED_PC_IN_CALL_DUMMY() calls now pass zero as the frame/sp + values as the caller knows that those values won't be used. Once + all architectures are using generic dummy frames, + DEPRECATED_PC_IN_CALL_DUMMY() can drop the sp/frame parameters. When it comes to finding a dummy frame, the next frame's frame ID (with out duing an unwind) can be used (ok, could if it wasn't for the need to change the way the PPC defined frame base in a strange @@ -201,13 +202,14 @@ extern enum frame_type get_frame_type (struct frame_info *); /* FIXME: cagney/2002-11-10: Some targets want to directly mark a frame as being of a specific type. This shouldn't be necessary. - PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and PC_IN_CALL_DUMMY() - indicates a DUMMY_FRAME. I suspect the real problem here is that - get_prev_frame() only sets initialized after INIT_EXTRA_FRAME_INFO - as been called. Consequently, some targets found that the frame's - type was wrong and tried to fix it. The correct fix is to modify - get_prev_frame() so that it initializes the frame's type before - calling any other functions. */ + PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and + DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME. I suspect + the real problem here is that get_prev_frame() only sets + initialized after INIT_EXTRA_FRAME_INFO as been called. + Consequently, some targets found that the frame's type was wrong + and tried to fix it. The correct fix is to modify get_prev_frame() + so that it initializes the frame's type before calling any other + functions. */ extern void deprecated_set_frame_type (struct frame_info *, enum frame_type type); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 54ca01212b3..b6f0b79a7d7 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1117,7 +1117,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 8027249df1a..c68a78fb378 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -188,7 +188,7 @@ struct gdbarch CORE_ADDR call_dummy_breakpoint_offset; int call_dummy_breakpoint_offset_p; int call_dummy_length; - gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy; + gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; int call_dummy_p; LONGEST * call_dummy_words; int sizeof_call_dummy_words; @@ -352,7 +352,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, + generic_pc_in_call_dummy, 0, 0, 0, @@ -528,7 +528,7 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->call_dummy_breakpoint_offset = -1; current_gdbarch->call_dummy_breakpoint_offset_p = -1; current_gdbarch->call_dummy_length = -1; - current_gdbarch->pc_in_call_dummy = generic_pc_in_call_dummy; + current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy; current_gdbarch->call_dummy_p = -1; current_gdbarch->call_dummy_words = legacy_call_dummy_words; current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; @@ -697,7 +697,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->call_dummy_length == -1)) fprintf_unfiltered (log, "\n\tcall_dummy_length"); - /* Skip verify of pc_in_call_dummy, invalid_p == 0 */ + /* Skip verify of deprecated_pc_in_call_dummy, has predicate */ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && (gdbarch->call_dummy_p == -1)) fprintf_unfiltered (log, "\n\tcall_dummy_p"); @@ -1146,6 +1146,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_extract_struct_value_address /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif +#ifdef DEPRECATED_PC_IN_CALL_DUMMY + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)", + XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = 0x%08lx\n", + (long) current_gdbarch->deprecated_pc_in_call_dummy + /*DEPRECATED_PC_IN_CALL_DUMMY ()*/); +#endif #ifdef DEPRECATED_STORE_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1596,17 +1607,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: PARM_BOUNDARY = %d\n", PARM_BOUNDARY); #endif -#ifdef PC_IN_CALL_DUMMY - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PC_IN_CALL_DUMMY(pc, sp, frame_address)", - XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n", - (long) current_gdbarch->pc_in_call_dummy - /*PC_IN_CALL_DUMMY ()*/); -#endif #ifdef PC_IN_SIGTRAMP fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -3450,22 +3450,30 @@ set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, } int -gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) +gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy; +} + +int +gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) { gdb_assert (gdbarch != NULL); - if (gdbarch->pc_in_call_dummy == 0) + if (gdbarch->deprecated_pc_in_call_dummy == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pc_in_call_dummy invalid"); + "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); + /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); - return gdbarch->pc_in_call_dummy (pc, sp, frame_address); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); + return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); } void -set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, - gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) +set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, + gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy) { - gdbarch->pc_in_call_dummy = pc_in_call_dummy; + gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy; } int diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 56b4f6bd5c8..f472e578599 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1058,20 +1058,46 @@ extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dum #endif #endif +/* NOTE: cagney/2002-11-24: This function with predicate has a valid + (callable) initial value. As a consequence, even when the predicate + is false, the corresponding function works. This simplifies the + migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), + doesn't need to be modified. */ + +#if defined (DEPRECATED_PC_IN_CALL_DUMMY) +/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */ +#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0) +#endif + +extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" +#endif +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PC_IN_CALL_DUMMY) -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) #endif -typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY) -#error "Non multi-arch definition of PC_IN_CALL_DUMMY" +typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY) -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) #endif #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 7c23c84bd19..cb879da3867 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -115,19 +115,25 @@ EOF test "${fmt}" || fmt="%ld" test "${print}" || print="(long) ${macro}" - case "${invalid_p}" in - 0 ) valid_p=1 ;; + case "${class}" in + F | V | M ) + case "${invalid_p}" in "" ) - if [ -n "${predefault}" ] + if test -n "${predefault}" -a "${predefault}" != "0" then #invalid_p="gdbarch->${function} == ${predefault}" - valid_p="gdbarch->${function} != ${predefault}" + predicate="gdbarch->${function} != ${predefault}" else - #invalid_p="gdbarch->${function} == 0" - valid_p="gdbarch->${function} != 0" + # filled in later + predicate="" fi ;; - * ) valid_p="!(${invalid_p})" + * ) + echo "Predicate function ${function} with invalid_p." + kill $$ + exit 1 + ;; + esac esac # PREDEFAULT is a valid fallback definition of MEMBER when @@ -495,7 +501,12 @@ v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1 v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END -f:1:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address:::generic_pc_in_call_dummy::0 +# NOTE: cagney/2002-11-24: This function with predicate has a valid +# (callable) initial value. As a consequence, even when the predicate +# is false, the corresponding function works. This simplifies the +# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), +# doesn't need to be modified. +F:1:DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx @@ -686,9 +697,6 @@ EOF do eval echo \"\ \ \ \ ${r}=\${${r}}\" done -# #fallbackdefault=${fallbackdefault} -# #valid_p=${valid_p} -#EOF if class_is_predicate_p && fallback_default_p then echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2 @@ -1650,11 +1658,11 @@ do printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n" printf "{\n" printf " gdb_assert (gdbarch != NULL);\n" - if [ -n "${valid_p}" ] + if [ -n "${predicate}" ] then - printf " return ${valid_p};\n" + printf " return ${predicate};\n" else - printf "#error \"gdbarch_${function}_p: not defined\"\n" + printf " return gdbarch->${function} != 0;\n" fi printf "}\n" fi @@ -1673,6 +1681,11 @@ do printf " if (gdbarch->${function} == 0)\n" printf " internal_error (__FILE__, __LINE__,\n" printf " \"gdbarch: gdbarch_${function} invalid\");\n" + if class_is_predicate_p && test -n "${predicate}" + then + # Allow a call to a function with a predicate. + printf " /* Ignore predicate (${predicate}). */\n" + fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" if [ "x${actual}" = "x-" -o "x${actual}" = "x" ] diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index e89a24e5d92..34cd1fbc832 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -492,7 +492,7 @@ h8300_frame_init_saved_regs (struct frame_info *fi) static CORE_ADDR h8300_frame_chain (struct frame_info *thisframe) { - if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) { /* initialize the from_pc now */ thisframe->extra_info->from_pc = deprecated_read_register_dummy (thisframe->pc, thisframe->frame, @@ -510,7 +510,7 @@ h8300_frame_chain (struct frame_info *thisframe) static CORE_ADDR h8300_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, E_PC_REGNUM); else @@ -540,7 +540,7 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) static CORE_ADDR h8300_frame_locals_address (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return (CORE_ADDR) 0; /* Not sure what else to do... */ return fi->extra_info->locals_pointer; } @@ -551,7 +551,7 @@ h8300_frame_locals_address (struct frame_info *fi) static CORE_ADDR h8300_frame_args_address (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return (CORE_ADDR) 0; /* Not sure what else to do... */ return fi->extra_info->args_pointer; } @@ -746,7 +746,7 @@ h8300_pop_frame (void) unsigned regno; struct frame_info *frame = get_current_frame (); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 5f3ea7d4429..d1230f12f7d 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -509,7 +509,7 @@ i386_frameless_signal_p (struct frame_info *frame) static CORE_ADDR i386_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) return frame->frame; if (get_frame_type (frame) == SIGTRAMP_FRAME @@ -566,7 +566,7 @@ i386_sigtramp_saved_sp (struct frame_info *frame) static CORE_ADDR i386_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) { ULONGEST pc; @@ -1594,7 +1594,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_register_convert_to_virtual); set_gdbarch_register_convert_to_raw (gdbarch, i386_register_convert_to_raw); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); /* "An argument's size is increased, if necessary, to make it a multiple of [32-bit] words. This may require tail padding, diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index c09f60dadde..0587f0b1f98 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -705,7 +705,7 @@ ia64_frame_chain (struct frame_info *frame) { if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return read_sigcontext_register (frame, sp_regnum); - else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; else { @@ -722,7 +722,7 @@ ia64_frame_saved_pc (struct frame_info *frame) { if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return read_sigcontext_register (frame, pc_regnum); - else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, pc_regnum); else { @@ -1233,7 +1233,7 @@ ia64_get_saved_register (char *raw_buffer, if (lval != NULL) *lval = not_lval; - is_dummy_frame = PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame); + is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame); if (regnum == SP_REGNUM && frame->next) { @@ -1481,7 +1481,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) { CORE_ADDR bsp, cfm; int next_frame_is_call_dummy = ((frame->next != NULL) - && PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame, + && DEPRECATED_PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame, frame->next->frame)); frame->extra_info = (struct frame_extra_info *) @@ -1518,7 +1518,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME)) cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM); else if (frn->next - && PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame, + && DEPRECATED_PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame, frn->next->frame)) cfm = deprecated_read_register_dummy (frn->next->pc, frn->next->frame, IA64_PFS_REGNUM); diff --git a/gdb/inferior.h b/gdb/inferior.h index 161f3b04fca..5d40fa76511 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -533,7 +533,7 @@ extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, */ #if !defined(CALL_DUMMY_HAS_COMPLETED) #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ - PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) + DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) #endif /* If STARTUP_WITH_SHELL is set, GDB's "run" diff --git a/gdb/infrun.c b/gdb/infrun.c index 73eed1f577a..c6dda16d869 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2052,7 +2052,7 @@ handle_inferior_event (struct execution_control_state *ecs) = !(bpstat_explains_signal (stop_bpstat) || trap_expected || (!CALL_DUMMY_BREAKPOINT_OFFSET_P - && PC_IN_CALL_DUMMY (stop_pc, read_sp (), + && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (), get_frame_base (get_current_frame ()))) || (step_range_end && step_resume_breakpoint == NULL)); @@ -2063,7 +2063,7 @@ handle_inferior_event (struct execution_control_state *ecs) news) give another signal besides SIGTRAP, so check here as well as above. */ || (!CALL_DUMMY_BREAKPOINT_OFFSET_P - && PC_IN_CALL_DUMMY (stop_pc, read_sp (), + && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (), get_frame_base (get_current_frame ())))); diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index b1bc3ed037b..649d396545a 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -386,7 +386,7 @@ m32r_init_extra_frame_info (struct frame_info *fi) memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -462,7 +462,7 @@ CORE_ADDR m32r_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->fsr.regs[regnum] != 0) return read_memory_integer (fi->fsr.regs[regnum], @@ -482,13 +482,13 @@ m32r_frame_chain (struct frame_info *fi) CORE_ADDR fn_start, callers_pc, fp; /* is this a dummy frame? */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return fi->frame; /* dummy frame same as caller's frame */ /* is caller-of-this a dummy frame? */ callers_pc = FRAME_SAVED_PC (fi); /* find out who called us: */ fp = m32r_find_callers_reg (fi, FP_REGNUM); - if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) + if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp)) return fp; /* dummy frame's frame may bear no relation to ours */ if (find_pc_partial_function (fi->pc, 0, &fn_start, 0)) @@ -527,7 +527,7 @@ m32r_pop_frame (struct frame_info *frame) { int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -554,7 +554,7 @@ m32r_pop_frame (struct frame_info *frame) CORE_ADDR m32r_frame_saved_pc (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); else return m32r_find_callers_reg (fi, RP_REGNUM); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 711d0818a79..2e21abf01ff 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -434,7 +434,7 @@ m68hc11_pop_frame (void) register CORE_ADDR fp, sp; register int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -812,7 +812,7 @@ m68hc11_frame_chain (struct frame_info *frame) { CORE_ADDR addr; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->extra_info->return_pc == 0 diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index d50cd25a071..3f16e19cc74 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1036,7 +1036,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 28); diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 916397af291..f29b3a87c79 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -756,7 +756,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi != NULL; fi = fi->next) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->saved_regs[regnum] != 0) return read_memory_integer (fi->saved_regs[regnum], @@ -772,7 +772,7 @@ CORE_ADDR mcore_frame_saved_pc (struct frame_info * fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); else return mcore_find_callers_reg (fi, PR_REGNUM); @@ -789,7 +789,7 @@ mcore_pop_frame (void) int rn; struct frame_info *fi = get_current_frame (); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) generic_pop_dummy_frame (); else { @@ -1047,7 +1047,7 @@ mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info->status = 0; fi->extra_info->framesize = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index dc80ff297c9..7a13a22eb7c 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1704,7 +1704,7 @@ mips_frame_saved_pc (struct frame_info *frame) int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM : (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM); - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) { LONGEST tmp; frame_unwind_signed_register (frame, PC_REGNUM, &tmp); @@ -2187,7 +2187,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) struct obj_section *sec; struct mips_objfile_private *priv; - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return NULL; find_pc_partial_function (pc, NULL, &startaddr, NULL); @@ -2427,7 +2427,7 @@ mips_frame_chain (struct frame_info *frame) if ((tmp = SKIP_TRAMPOLINE_CODE (saved_pc)) != 0) saved_pc = tmp; - if (PC_IN_CALL_DUMMY (saved_pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (saved_pc, 0, 0)) { /* A dummy frame, uses SP not FP. Get the old SP value. If all is well, frame->frame the bottom of the current frame will @@ -2452,7 +2452,7 @@ mips_frame_chain (struct frame_info *frame) && !(get_frame_type (frame) == SIGTRAMP_FRAME) /* For a generic dummy frame, let get_frame_pointer() unwind a register value saved as part of the dummy frame call. */ - && !(PC_IN_CALL_DUMMY (frame->pc, 0, 0))) + && !(DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0))) return 0; else return get_frame_pointer (frame, proc_desc); @@ -2482,7 +2482,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) if (fci->pc == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc)) fci->frame = read_next_frame_reg (fci->next, SP_REGNUM); - else if (PC_IN_CALL_DUMMY (fci->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fci->pc, 0, 0)) /* Do not ``fix'' fci->frame. It will have the value of the generic dummy frame's top-of-stack (since the draft fci->frame is obtained by returning the unwound stack @@ -3812,7 +3812,7 @@ mips_pop_frame (void) CORE_ADDR new_sp = get_frame_base (frame); mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc; - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) { generic_pop_dummy_frame (); flush_cached_frames (); diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c index 3f56ab3bb78..fdc0941fee7 100644 --- a/gdb/mn10200-tdep.c +++ b/gdb/mn10200-tdep.c @@ -685,7 +685,7 @@ mn10200_pop_frame (struct frame_info *frame) { int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 5a0a0d68418..f68664d19b6 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1195,7 +1195,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index fecd134e7b5..26e88cd3b14 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -616,7 +616,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 3); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 0); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index bb94e1a4e49..b6e336bbb68 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -958,7 +958,7 @@ rs6000_pop_frame (void) pc = read_pc (); sp = get_frame_base (frame); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); flush_cached_frames (); @@ -1514,7 +1514,7 @@ rs6000_frame_saved_pc (struct frame_info *fi) if ((get_frame_type (fi) == SIGTRAMP_FRAME)) return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); func_start = get_pc_function_start (fi->pc); @@ -1531,7 +1531,7 @@ rs6000_frame_saved_pc (struct frame_info *fi) if ((get_frame_type (fi->next) == SIGTRAMP_FRAME)) return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET, wordsize); - else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0)) /* The link register wasn't saved by this frame and the next (inner, newer) frame is a dummy. Get the link register value by unwinding it from that [dummy] frame. */ @@ -1744,7 +1744,7 @@ rs6000_frame_chain (struct frame_info *thisframe) CORE_ADDR fp, fpp, lr; int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; - if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) /* A dummy frame always correctly chains back to the previous frame. */ return read_memory_addr ((thisframe)->frame, wordsize); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index df202b4aa7b..622f2850738 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1825,7 +1825,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, s390_push_arguments); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 9a542ec4df7..b25ff5ab87c 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -927,7 +927,7 @@ gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info) static CORE_ADDR sh_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->pc && !inside_entry_file (frame->pc)) return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4); @@ -965,7 +965,7 @@ translate_insn_rn (int rn, int media_mode) static CORE_ADDR sh64_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->pc && !inside_entry_file (frame->pc)) { @@ -990,7 +990,7 @@ static CORE_ADDR sh_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) /* When the caller requests PR from the dummy frame, we return PC because that's where the previous routine appears to have done a call from. */ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); @@ -1012,7 +1012,7 @@ sh64_get_saved_pr (struct frame_info *fi, int pr_regnum) int media_mode = 0; for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) /* When the caller requests PR from the dummy frame, we return PC because that's where the previous routine appears to have done a call from. */ return deprecated_read_register_dummy (fi->pc, fi->frame, pr_regnum); @@ -1725,7 +1725,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1757,7 +1757,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1814,7 +1814,7 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, while (frame && ((frame = frame->next) != NULL)) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { if (lval) /* found it in a CALL_DUMMY frame */ *lval = not_lval; @@ -1908,7 +1908,7 @@ sh_pop_frame (void) register CORE_ADDR fp; register int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -1938,7 +1938,7 @@ sh64_pop_frame (void) int media_mode = pc_is_isa32 (frame->pc); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 149aa88a059..1d07c03ce68 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -3197,7 +3197,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* 32-bit machine types: */ #ifdef SPARC32_CALL_DUMMY_ON_STACK - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30); set_gdbarch_call_dummy_length (gdbarch, 0x38); @@ -3248,7 +3248,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_words (gdbarch, call_dummy_32); #else - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); @@ -3295,7 +3295,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) default: /* Any new machine type is likely to be 64-bit. */ #ifdef SPARC64_CALL_DUMMY_ON_STACK - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4); set_gdbarch_call_dummy_length (gdbarch, 192); @@ -3303,7 +3303,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 148); set_gdbarch_call_dummy_words (gdbarch, call_dummy_64); #else - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 419c7e8b84b..6c547691046 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -800,7 +800,7 @@ CORE_ADDR v850_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->saved_regs[regnum] != 0) return read_memory_unsigned_integer (fi->saved_regs[regnum], @@ -826,7 +826,7 @@ v850_frame_chain (struct frame_info *fi) callers_pc = FRAME_SAVED_PC (fi); /* If caller is a call-dummy, then our FP bears no relation to his FP! */ fp = v850_find_callers_reg (fi, E_FP_RAW_REGNUM); - if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) + if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp)) return fp; /* caller is call-dummy: return oldest value of FP */ /* Caller is NOT a call-dummy, so everything else should just work. @@ -883,7 +883,7 @@ v850_pop_frame (void) struct frame_info *frame = get_current_frame (); int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -1009,7 +1009,7 @@ v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp) CORE_ADDR v850_frame_saved_pc (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM); else return v850_find_callers_reg (fi, E_RP_REGNUM); @@ -1111,7 +1111,7 @@ v850_frame_init_saved_regs (struct frame_info *fi) /* The call dummy doesn't save any registers on the stack, so we can return now. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return; /* Find the beginning of this function, so we can analyze its diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 6a936837162..119f0130832 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -691,7 +691,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index b182b79bef1..8b76341567c 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1099,7 +1099,7 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index e8bc422564f..7d592161462 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -333,7 +333,7 @@ xstormy16_pop_frame (void) if (fi == NULL) return; /* paranoia */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { generic_pop_dummy_frame (); } @@ -466,7 +466,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, if (fi) { /* In a call dummy, don't touch the frame. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return start_addr; /* Grab the frame-relative values of SP and FP, needed below. @@ -756,7 +756,7 @@ xstormy16_frame_saved_pc (struct frame_info *fi) { CORE_ADDR saved_pc; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { saved_pc = deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM); @@ -817,7 +817,7 @@ xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi) static CORE_ADDR xstormy16_frame_chain (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* Call dummy's frame is the same as caller's. */ return fi->frame; -- 2.30.2