aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-04-08 21:56:10 +0000
committerAndrew Cagney <cagney@redhat.com>2003-04-08 21:56:10 +0000
commit4443bd8373866e76ec700a8bb3f5df8a50ba3714 (patch)
tree9b8a010feedc37eff9c2dcde41f59f484c9f0418 /gdb/infrun.c
parenta66624bc3e854775dc9857ce23ead38b741f9dbe (diff)
downloadgdb-4443bd8373866e76ec700a8bb3f5df8a50ba3714.zip
gdb-4443bd8373866e76ec700a8bb3f5df8a50ba3714.tar.gz
gdb-4443bd8373866e76ec700a8bb3f5df8a50ba3714.tar.bz2
2003-04-08 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (SAVED_PC_AFTER_CALL): Add a predicate. * gdbarch.h, gdbarch.c: Re-generate. * d10v-tdep.c (d10v_saved_pc_after_call): Delete function. (d10v_gdbarch_init): Do not set saved_pc_after_call. * infrun.c (step_over_function): Call SAVED_PC_AFTER_CALL_P conditionally, use frame_pc_unwind as an alternative. Add comments. * arch-utils.c (init_frame_pc_default): Only call SAVED_PC_AFTER_CALL when available.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index be6e092..3fda964 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2675,7 +2675,44 @@ step_over_function (struct execution_control_state *ecs)
struct symtab_and_line sr_sal;
init_sal (&sr_sal); /* initialize to zeros */
- sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+
+ /* NOTE: cagney/2003-04-06:
+
+ At this point the equality get_frame_pc() == get_frame_func()
+ should hold. This may make it possible for this code to tell the
+ frame where it's function is, instead of the reverse. This would
+ avoid the need to search for the frame's function, which can get
+ very messy when there is no debug info available (look at the
+ heuristic find pc start code found in targets like the MIPS). */
+
+ /* NOTE: cagney/2003-04-06: Deprecate SAVED_PC_AFTER_CALL?
+
+ The intent of SAVED_PC_AFTER_CALL was to:
+
+ - provide a very light weight equivalent to frame_unwind_pc()
+ (nee FRAME_SAVED_PC) that avoids the prologue analyzer
+
+ - avoid handling the case where the PC hasn't been saved in the
+ prologue analyzer
+
+ Unfortunatly, not five lines further down, is a call to
+ get_frame_id() and that is guarenteed to trigger the prologue
+ analyzer.
+
+ The `correct fix' is for the prologe analyzer to handle the case
+ where the prologue is incomplete (PC in prologue) and,
+ consequently, the return pc has not yet been saved. It should be
+ noted that the prologue analyzer needs to handle this case
+ anyway: frameless leaf functions that don't save the return PC;
+ single stepping through a prologue.
+
+ The d10v handles all this by bailing out of the prologue analsis
+ when it reaches the current instruction. */
+
+ if (SAVED_PC_AFTER_CALL_P ())
+ sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ else
+ sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (get_current_frame ()));
sr_sal.section = find_pc_overlay (sr_sal.pc);
check_for_old_step_resume_breakpoint ();