From d082b2bb9259bf3063b43a9dd7e33188172627e4 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 29 Feb 2000 07:17:15 +0000 Subject: [PATCH] Add more checks for no stack frame. --- gdb/ChangeLog | 6 ++++++ gdb/infrun.c | 3 ++- gdb/stack.c | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 493bd7d9dcb..4c4ecd5c4c7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 29 17:33:49 2000 Andrew Cagney + + From Wed, 23 Feb 2000 Fernando Nasser : + * stack.c (backtrace_command_1), infrun.c (normal_stop): Check + that the target's stack was valid. + Tue Feb 29 15:14:56 2000 Andrew Cagney From 2000-02-22 Stephane Carrez : diff --git a/gdb/infrun.c b/gdb/infrun.c index 2a3a1c8f99a..96a659ebf4a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3429,7 +3429,8 @@ The same program may be running in another process.\n"); bpstat_print() contains the logic deciding in detail what to print, based on the event(s) that just occurred. */ - if (stop_print_frame) + if (stop_print_frame + && selected_frame) { int bpstat_ret; int source_flag; diff --git a/gdb/stack.c b/gdb/stack.c index c586f4573da..8684b7b7b9c 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1111,6 +1111,12 @@ backtrace_command_1 (count_exp, show_locals, from_tty) printing. Second, it must set the variable count to the number of frames which we should print, or -1 if all of them. */ trailing = get_current_frame (); + + /* The target can be in a state where there is no valid frames + (e.g., just connected). */ + if (trailing == NULL) + error ("No stack."); + trailing_level = 0; if (count_exp) { -- 2.30.2