mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
gdb/
Revert: 2012-01-02 Jan Kratochvil <jan.kratochvil@redhat.com> Joel Brobecker <brobecker@adacore.com> 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.
This commit is contained in:
parent
15bbba8d0d
commit
5931a2fae3
@ -1,3 +1,18 @@
|
|||||||
|
2012-01-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Revert:
|
||||||
|
2012-01-02 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
Joel Brobecker <brobecker@adacore.com>
|
||||||
|
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.
|
||||||
|
|
||||||
2012-01-04 Joel Brobecker <brobecker@adacore.com>
|
2012-01-04 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* linespec.c (add_minsym): Preserve function descriptors.
|
* linespec.c (add_minsym): Preserve function descriptors.
|
||||||
|
@ -85,7 +85,7 @@ displaced_step_at_entry_point (struct gdbarch *gdbarch)
|
|||||||
We don't want displaced stepping to interfere with those
|
We don't want displaced stepping to interfere with those
|
||||||
breakpoints, so leave space. */
|
breakpoints, so leave space. */
|
||||||
gdbarch_breakpoint_from_pc (gdbarch, &addr, &bp_len);
|
gdbarch_breakpoint_from_pc (gdbarch, &addr, &bp_len);
|
||||||
addr += bp_len * 3;
|
addr += bp_len * 2;
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
@ -629,6 +629,17 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
|
|||||||
args, nargs, target_values_type,
|
args, nargs, target_values_type,
|
||||||
&real_pc, &bp_addr, get_current_regcache ());
|
&real_pc, &bp_addr, get_current_regcache ());
|
||||||
break;
|
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:
|
case AT_SYMBOL:
|
||||||
/* Some executables define a symbol __CALL_DUMMY_ADDRESS whose
|
/* Some executables define a symbol __CALL_DUMMY_ADDRESS whose
|
||||||
address is the location where the breakpoint should be
|
address is the location where the breakpoint should be
|
||||||
@ -648,39 +659,11 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
|
|||||||
dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
|
dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
|
||||||
dummy_addr,
|
dummy_addr,
|
||||||
¤t_target);
|
¤t_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
|
||||||
/* FALLTHROUGH */
|
dummy_addr = entry_point_address ();
|
||||||
case AT_ENTRY_POINT:
|
/* A call dummy always consists of just a single breakpoint,
|
||||||
{
|
so it's address is the same as the address of the dummy. */
|
||||||
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;
|
bp_addr = dummy_addr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1074,7 +1074,7 @@ ppc_linux_displaced_step_location (struct gdbarch *gdbarch)
|
|||||||
/* Inferior calls also use the entry point as a breakpoint location.
|
/* Inferior calls also use the entry point as a breakpoint location.
|
||||||
We don't want displaced stepping to interfere with those
|
We don't want displaced stepping to interfere with those
|
||||||
breakpoints, so leave space. */
|
breakpoints, so leave space. */
|
||||||
ppc_linux_entry_point_addr = addr + 3 * PPC_INSN_SIZE;
|
ppc_linux_entry_point_addr = addr + 2 * PPC_INSN_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ppc_linux_entry_point_addr;
|
return ppc_linux_entry_point_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user