aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-13 20:37:28 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-13 20:37:28 +0000
commit3e210248bd30a25cad7598cf3acd95a9a6d933be (patch)
tree7fa982732833ae8cc48536b31b453e223d86b98a /gdb/infcall.c
parente3305dd95bcbe5169d4d074a6d3d1d0393d4b532 (diff)
downloadgdb-3e210248bd30a25cad7598cf3acd95a9a6d933be.zip
gdb-3e210248bd30a25cad7598cf3acd95a9a6d933be.tar.gz
gdb-3e210248bd30a25cad7598cf3acd95a9a6d933be.tar.bz2
2003-06-13 Andrew Cagney <cagney@redhat.com>
* infcall.c (call_function_by_hand): When UNWIND_DUMMY_ID is available, do not use the FP register, and always save the TOS. * dummy-frame.c (dummy_frame_this_id): Do not assert SAVE_DUMMY_FRAME_TOS. * i386-tdep.c (i386_save_dummy_frame_tos): Delete function. (i386_gdbarch_init): Do not set save_dummy_frame_tos. (i386_push_dummy_call): Add 8 to the returned SP. * frame.c (legacy_frame_p): Do not require SAVE_DUMMY_FRAME_TOS. * d10v-tdep.c (d10v_unwind_dummy_id): Use d10v_unwind_sp. (d10v_gdbarch_init): Do not set save_dummy_frame_tos. * x86-64-tdep.c (x86_64_save_dummy_frame_tos): Delete function. (x86_64_push_dummy_call): Return "sp + 16". (x86_64_init_abi): Do not set save_dummy_frame_tos. * alpha-tdep.c (alpha_gdbarch_init): Do not set save_dummy_frame_tos.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 23a5664..0a10c31 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -823,7 +823,15 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
if (DEPRECATED_DUMMY_WRITE_SP_P ())
DEPRECATED_DUMMY_WRITE_SP (sp);
- if (SAVE_DUMMY_FRAME_TOS_P ())
+ if (gdbarch_unwind_dummy_id_p (current_gdbarch))
+ {
+ /* Sanity. The exact same SP value is returned by
+ PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
+ unwind_dummy_id to form the frame ID's stack address. */
+ gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
+ generic_save_dummy_frame_tos (sp);
+ }
+ else if (SAVE_DUMMY_FRAME_TOS_P ())
SAVE_DUMMY_FRAME_TOS (sp);
/* Now proceed, having reached the desired place. */
@@ -843,17 +851,29 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
set_momentary_breakpoint. We need to give the breakpoint a
frame ID so that the breakpoint code can correctly re-identify
the dummy breakpoint. */
- /* The assumption here is that push_dummy_call() returned the
- stack part of the frame ID. Unfortunatly, many older
- architectures were, via a convoluted mess, relying on the
- poorly defined and greatly overloaded DEPRECATED_TARGET_READ_FP
- or DEPRECATED_FP_REGNUM to supply the value. */
- if (DEPRECATED_TARGET_READ_FP_P ())
- frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc);
- else if (DEPRECATED_FP_REGNUM >= 0)
- frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc);
+ if (gdbarch_unwind_dummy_id_p (current_gdbarch))
+ {
+ /* Sanity. The exact same SP value is returned by
+ PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
+ unwind_dummy_id to form the frame ID's stack address. */
+ gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
+ frame = frame_id_build (sp, sal.pc);
+ }
else
- frame = frame_id_build (sp, sal.pc);
+ {
+ /* The assumption here is that push_dummy_call() returned the
+ stack part of the frame ID. Unfortunatly, many older
+ architectures were, via a convoluted mess, relying on the
+ poorly defined and greatly overloaded
+ DEPRECATED_TARGET_READ_FP or DEPRECATED_FP_REGNUM to supply
+ the value. */
+ if (DEPRECATED_TARGET_READ_FP_P ())
+ frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc);
+ else if (DEPRECATED_FP_REGNUM >= 0)
+ frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc);
+ else
+ frame = frame_id_build (sp, sal.pc);
+ }
bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy);
bpt->disposition = disp_del;
}