diff --git a/gdb/thread.c b/gdb/thread.c
index 0f86f6efe38..bbcd3e61cd1 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -2141,19 +2141,16 @@ print_selected_thread_frame (struct ui_out *uiout,
 	  uiout->text (target_pid_to_str (inferior_ptid));
 	  uiout->text (")]");
 	}
-    }
 
-  if (tp->state () == THREAD_RUNNING)
-    {
-      if (selection & USER_SELECTED_THREAD)
-	uiout->text ("(running)\n");
+      if (tp->state () == THREAD_RUNNING)
+	uiout->text ("(running)");
+
+      uiout->text ("\n");
     }
-  else if (selection & USER_SELECTED_FRAME)
-    {
-      if (selection & USER_SELECTED_THREAD)
-	uiout->text ("\n");
 
-      if (has_stack_frames ())
+  if (selection & USER_SELECTED_FRAME)
+    {
+      if ((tp->state () != THREAD_RUNNING) && has_stack_frames ())
 	print_stack_frame_to_uiout (uiout, get_selected_frame (),
 				    1, SRC_AND_LOC, 1);
     }
