diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-04-22 20:08:53 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-04-22 20:08:53 +0000 |
commit | 777bef06cd075ee4031187fe28381d5d5edd4f94 (patch) | |
tree | 0ca9c4eaec086bb1a36e3ae9a7f6f29757612ca7 /gdb/inflow.c | |
parent | fcb887ffcd896af0b53c7ac8808bfeed54b321e8 (diff) | |
download | gdb-777bef06cd075ee4031187fe28381d5d5edd4f94.zip gdb-777bef06cd075ee4031187fe28381d5d5edd4f94.tar.gz gdb-777bef06cd075ee4031187fe28381d5d5edd4f94.tar.bz2 |
Check for NULL selected_frame in various places.
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r-- | gdb/inflow.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c index 6e6905f..3d0c68a 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -364,6 +364,16 @@ kill_command (arg, from_tty) if (!query ("Kill the inferior process? ")) error ("Not confirmed."); target_kill (arg, from_tty); + + /* Killing off the inferior can leave us with a core file. If so, + print the state we are left in. */ + if (target_has_stack) { + printf_filtered ("In %s,\n", current_target->to_longname); + if (selected_frame == NULL) + fputs_filtered ("No selected stack frame.\n", stdout); + else + print_sel_frame (0); + } } /* The inferior process has died. Long live the inferior! */ @@ -381,13 +391,15 @@ generic_mourn_inferior () CLEAR_DEFERRED_STORES; #endif - select_frame ((FRAME) 0, -1); reopen_exec_file (); - if (target_has_stack) + if (target_has_stack) { set_current_frame ( create_new_frame (read_register (FP_REGNUM), read_pc ())); - else + select_frame (get_current_frame (), 0); + } else { set_current_frame (0); + select_frame ((FRAME) 0, -1); + } /* It is confusing to the user for ignore counts to stick around from previous runs of the inferior. So clear them. */ breakpoint_clear_ignore_counts (); |