From 73b65bb0693827163135f5af96ebba03470badd4 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 8 Sep 2003 20:13:48 +0000 Subject: [PATCH] * infrun.c (normal_stop): Don't print a message if the inferior has exited. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 15c342c0180..308c71919c6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-09-08 Daniel Jacobowitz + + * infrun.c (normal_stop): Don't print a message if the inferior + has exited. + 2003-09-08 Jim Blandy * Makefile.in (dbxread.o): Note new dependency on $(gdb_assert_h). diff --git a/gdb/infrun.c b/gdb/infrun.c index 01460efa1f5..ff956d3db47 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3054,14 +3054,22 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) void normal_stop (void) { + struct target_waitstatus last; + ptid_t last_ptid; + + get_last_target_status (&last_ptid, &last); + /* As with the notification of thread events, we want to delay notifying the user that we've switched thread context until the inferior actually stops. - (Note that there's no point in saying anything if the inferior - has exited!) */ + There's no point in saying anything if the inferior has exited. + Note that SIGNALLED here means "exited with a signal", not + "received a signal". */ if (!ptid_equal (previous_inferior_ptid, inferior_ptid) - && target_has_execution) + && target_has_execution + && last.kind != TARGET_WAITKIND_SIGNALLED + && last.kind != TARGET_WAITKIND_EXITED) { target_terminal_ours_for_output (); printf_filtered ("[Switching to %s]\n", -- 2.30.2