Hi everyone, I noticed a potential problem in thread.c: the "thread apply" commands change the selected frame, I think it should not. If you are doing (gdb) up (gdb) thread apply all print 1 (gdb) down then the frame selected before the up is not being restored by the down, we have an error message instead. In the following patch: 1- I've added the restoring of the the selected frame in the restoring of the current thread. All is done in the make_cleanup_restore_current_thread() and do_restore_current_thread_cleanup() functions. I don't know if there could be some cases where we don't want to restore the selected frame when having changed the current thread ? If so may be we can separate both restoring. I'm also wondering about getting the selected frame in make_cleanup_restore_current_thread() directly without passing it as an argument. You're comments are welcome. 2- I removed the print_stack_frame from the restore_current_thread() function, I think it's up to the caller to decide if he need to print or not the stack frame? About that I think I must print the selected frame, not the current. What's your opinion ? 3- I saw in info_threads_command() that the selected frame was restored because the usage of switch_to_thread() changed it, so I used in info_threads_command() the same principle as above, using cleanup function. I also removed show_stack_frame() since it does nothing. I need your opinion before going ahead in this patch. -- Denis