From da59e08184255e09e51e54bb356e4448d33b2245 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 1 Feb 2000 03:19:29 +0000 Subject: import gdb-2000-01-31 snapshot --- gdb/infcmd.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'gdb/infcmd.c') diff --git a/gdb/infcmd.c b/gdb/infcmd.c index e61221a..082d957 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -838,8 +838,13 @@ breakpoint_auto_delete_contents (arg) The dummy's frame is automatically popped whenever that break is hit. If that is the first time the program stops, run_stack_dummy returns to its caller with that frame already gone and returns 0. - Otherwise, run_stack-dummy returns 1 (the frame will eventually be popped - when we do hit that breakpoint). */ + + Otherwise, run_stack-dummy returns a non-zero value. + If the called function receives a random signal, we do not allow the user + to continue executing it as this may not work. The dummy frame is poped + and we return 1. + If we hit a breakpoint, we leave the frame in place and return 2 (the frame + will eventually be popped when we do hit the dummy end breakpoint). */ int run_stack_dummy (addr, buffer) @@ -907,10 +912,24 @@ run_stack_dummy (addr, buffer) discard_cleanups (old_cleanups); + if (stopped_by_random_signal) + { + /* If the inferior execution fails we need to restore our + stack. It is not done by proceed() in this case. */ + /* Pop the empty frame that contains the stack dummy. + POP_FRAME ends with a setting of the current frame, so we + can use that next. */ + POP_FRAME; + return 1; + } + + /* We may also stop prematurely because we hit a breakpoint in the + called routine. We do not pop the frame as the user may wish + to single step or continue from there. */ if (!stop_stack_dummy) - return 1; + return 2; - /* On return, the stack dummy has been popped already. */ + /* On normal return, the stack dummy has been popped already. */ memcpy (buffer, stop_registers, REGISTER_BYTES); return 0; -- cgit v1.1