RFC: Frame cache s not always available.
Andrew Cagney
ac131313@cygnus.com
Mon Feb 28 23:00:00 GMT 2000
Fernando Nasser wrote:
>
> We are starting to talk about situations where the frames should not
> considered valid. For some oversighting, or maybe because it is
> gradually being implemented, gdb only tests for the return value of
> get_current_frame() in one place and assumes in several places that
> selected_frame is set.
>
> I found two places that are more troublesome and created the attached
> patch. I did implement the frame invalid situation in the arm target
> (on my sandbox only) and this two changes alone were enough. We may
> found a few others in the future, and the situation were we do not have
> a current or selected frame are not checked in yet, but I believe we
> should make the code more robust and check this patch in anyway.
FYI,
I applied the attatched.
Andrew
Tue Feb 29 17:33:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
From Wed, 23 Feb 2000 Fernando Nasser <fnasser@redhat.com>:
* stack.c (backtrace_command_1), infrun.c (normal_stop): Check
that the target's stack was valid.
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.3
diff -p -r1.3 infrun.c
*** infrun.c 2000/02/23 00:25:42 1.3
--- infrun.c 2000/02/29 06:54:55
*************** The same program may be running in anoth
*** 3429,3435 ****
bpstat_print() contains the logic deciding in detail
what to print, based on the event(s) that just occurred. */
! if (stop_print_frame)
{
int bpstat_ret;
int source_flag;
--- 3429,3436 ----
bpstat_print() contains the logic deciding in detail
what to print, based on the event(s) that just occurred. */
! if (stop_print_frame
! && selected_frame)
{
int bpstat_ret;
int source_flag;
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.2
diff -p -r1.2 stack.c
*** stack.c 2000/02/08 04:39:02 1.2
--- stack.c 2000/02/29 06:55:00
*************** backtrace_command_1 (count_exp, show_loc
*** 1111,1116 ****
--- 1111,1122 ----
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)
{
More information about the Gdb-patches
mailing list