From: Luis Machado Date: Wed, 7 Sep 2011 02:33:58 +0000 (+0000) Subject: 2011-09-06 Luis Machado X-Git-Tag: binutils-2_22-branchpoint~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=861152be0e99b1f69a1ce907d9067dc6123ac4da;p=thirdparty%2Fbinutils-gdb.git 2011-09-06 Luis Machado * frame.c (has_stack_frames): Check for currently selected traceframe. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index af56e35bdf9..29543294de9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-09-06 Luis Machado + + * frame.c (has_stack_frames): Check for currently selected + traceframe. + 2011-09-06 Pedro Alves * event-top.h (MAXPROMPTS, struct prompts): Delete. diff --git a/gdb/frame.c b/gdb/frame.c index 37f106a92b2..fc581fb1abe 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1328,17 +1328,21 @@ has_stack_frames (void) if (!target_has_registers || !target_has_stack || !target_has_memory) return 0; - /* No current inferior, no frame. */ - if (ptid_equal (inferior_ptid, null_ptid)) - return 0; + /* Traceframes are effectively a substitute for the live inferior. */ + if (get_traceframe_number () < 0) + { + /* No current inferior, no frame. */ + if (ptid_equal (inferior_ptid, null_ptid)) + return 0; - /* Don't try to read from a dead thread. */ - if (is_exited (inferior_ptid)) - return 0; + /* Don't try to read from a dead thread. */ + if (is_exited (inferior_ptid)) + return 0; - /* ... or from a spinning thread. */ - if (is_executing (inferior_ptid)) - return 0; + /* ... or from a spinning thread. */ + if (is_executing (inferior_ptid)) + return 0; + } return 1; }