struct gdbarch *gdbarch;
struct breakpoint *terminate_bp = NULL;
struct minimal_symbol *tm;
+ struct cleanup *terminate_bp_cleanup = NULL;
ptid_t call_thread_ptid;
struct gdb_exception e;
const char *name;
real_pc = funaddr;
dummy_addr = entry_point_address ();
- /* Make certain that the address points at real code, and not a
- function descriptor. */
- dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
- dummy_addr,
- ¤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;
sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
real_pc = funaddr;
if (sym)
- dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+ {
+ dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+ /* Make certain that the address points at real code, and not
+ a function descriptor. */
+ dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
+ dummy_addr,
+ ¤t_target);
+ }
else
dummy_addr = entry_point_address ();
- /* Make certain that the address points at real code, and not
- a function descriptor. */
- dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
- dummy_addr,
- ¤t_target);
/* A call dummy always consists of just a single breakpoint,
so it's address is the same as the address of the dummy. */
bp_addr = dummy_addr;
struct breakpoint *bpt;
struct symtab_and_line sal;
init_sal (&sal); /* initialize to zeroes */
+ sal.pspace = current_program_space;
sal.pc = bp_addr;
sal.section = find_pc_overlay (sal.pc);
/* Sanity. The exact same SP value is returned by
/* Register a clean-up for unwind_on_terminating_exception_breakpoint. */
if (terminate_bp)
- make_cleanup_delete_breakpoint (terminate_bp);
+ terminate_bp_cleanup = make_cleanup_delete_breakpoint (terminate_bp);
/* - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP -
If you're looking to implement asynchronous dummy-frames, then
user. */
if (terminate_bp != NULL
- && (inferior_thread()->stop_bpstat->breakpoint_at->address
+ && (inferior_thread ()->stop_bpstat->breakpoint_at->address
== terminate_bp->loc->address))
{
/* We must get back to the frame we were before the
internal_error (__FILE__, __LINE__, _("... should not be here"));
}
+ /* If we get here and the std::terminate() breakpoint has been set,
+ it has to be cleaned manually. */
+ if (terminate_bp)
+ do_cleanups (terminate_bp_cleanup);
+
/* If we get here the called FUNCTION ran to completion,
and the dummy frame has already been popped. */