aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-01-02 02:52:20 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-01-02 02:52:20 +0000
commitb5914469f9dd6b332ed51eea9b5954bd12375cd7 (patch)
treeaf3b71417c86de116ed14ea2f425f27394d45acb /gdb/infcall.c
parent8da828f7603894565a82a0d3378277dc78c00f32 (diff)
downloadgdb-b5914469f9dd6b332ed51eea9b5954bd12375cd7.zip
gdb-b5914469f9dd6b332ed51eea9b5954bd12375cd7.tar.gz
gdb-b5914469f9dd6b332ed51eea9b5954bd12375cd7.tar.bz2
gdb/
Fix regression for gdb.cp/gdb2495.exp with gcc-4.7. * arch-utils.c (displaced_step_at_entry_point): Incrase BP_LEN skip to 3 times. * infcall.c (call_function_by_hand) <AT_SYMBOL>: Move it upwards and fall through into AT_ENTRY_POINT. (call_function_by_hand) <AT_ENTRY_POINT>: New variable bp_len. Adjust DUMMY_ADDR with it. * ppc-linux-tdep.c (ppc_linux_displaced_step_location): Increase PPC_INSN_SIZE skip to 3 times.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index b8b7ff5..e3171d7 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -631,17 +631,6 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
args, nargs, target_values_type,
&real_pc, &bp_addr, get_current_regcache ());
break;
- case AT_ENTRY_POINT:
- {
- CORE_ADDR dummy_addr;
-
- real_pc = funaddr;
- dummy_addr = entry_point_address ();
- /* A call dummy always consists of just a single breakpoint, so
- its address is the same as the address of the dummy. */
- bp_addr = dummy_addr;
- break;
- }
case AT_SYMBOL:
/* Some executables define a symbol __CALL_DUMMY_ADDRESS whose
address is the location where the breakpoint should be
@@ -661,11 +650,39 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
dummy_addr,
&current_target);
+ /* A call dummy always consists of just a single breakpoint,
+ so its address is the same as the address of the dummy. */
+ bp_addr = dummy_addr;
+ break;
}
- else
- dummy_addr = entry_point_address ();
- /* A call dummy always consists of just a single breakpoint,
- so it's address is the same as the address of the dummy. */
+ }
+ /* FALLTHROUGH */
+ case AT_ENTRY_POINT:
+ {
+ CORE_ADDR dummy_addr;
+ int bp_len;
+
+ real_pc = funaddr;
+ dummy_addr = entry_point_address ();
+
+ /* If the inferior call throws an uncaught C++ exception,
+ the inferior unwinder tries to unwind all frames, including
+ our dummy frame. The unwinder determines the address of
+ the calling instruction by subtracting 1 to the return
+ address. So, using the entry point's address as the return
+ address would lead the unwinder to use the unwinding
+ information of the code immediately preceding the entry
+ point. This information, if found, is invalid for the dummy
+ frame, and can potentially crash the inferior's unwinder.
+ Therefore, we adjust the return address by the length of
+ a breakpoint, guaranteeing that the unwinder finds the
+ correct function as the caller. */
+
+ gdbarch_breakpoint_from_pc (gdbarch, &dummy_addr, &bp_len);
+ dummy_addr += bp_len;
+
+ /* A call dummy always consists of just a single breakpoint, so
+ its address is the same as the address of the dummy. */
bp_addr = dummy_addr;
break;
}