On Friday 14 March 2008 18:11:15 Daniel Jacobowitz wrote: > On Fri, Mar 14, 2008 at 11:07:32AM -0400, Daniel Jacobowitz wrote: > >        /* That switch put us at the top of the stack (leaf frame).  */ > >        switch_to_thread (tp->ptid); > >        print_stack_frame (get_selected_frame (NULL), 0, LOCATION); > > I think Nick was right about printing the frame level.  It's not > necessarily going to be zero in the future.  For instance, GDB might > automatically select the nearest user frame if you stop when a C++ > exception is thrown, like we already do for Ada; and then we could > teach GDB not to lose the selected frame whenever it switches threads. > That wants doing anyway. Ok, I've enabled printing of stack level. > > > I have realized that while the patch is mostly about MI, it also > > > touches generic code -- thread.c. Is that part of patch (attached again > > > for convenience) OK? > > Oh, one other thing. I went back to look at Denis's patches. He made > -thread-info without an argument describe the current thread only. > Doesn't that seem useful, especially before we get notifications > completely hammered out? I do not see any other MI command that > reports the current thread. > > So that would mean we needed -thread-list-all-threads back again. Hmm, I'd rather not. Currently, the current thread is reported by *stopped, and is not supposed to randomly change -- because the target is fully stopped while frontend talks with gdb. Therefore, using -thread-info as a roundabout way to get the current thread does not really give you anything. For non-stop mode, I have long and evil plans that I'll post soon, but they don't require this either. I attach the patch revised per your comments. How does it look? - Volodya