public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: extra debug output in thread.c
@ 2022-10-10 11:19 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-10-10 11:19 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=58fd1204aa0f66dd2df30f673c9441e0265b8515

commit 58fd1204aa0f66dd2df30f673c9441e0265b8515
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Mon Sep 5 16:56:35 2022 +0100

    gdb: extra debug output in thread.c
    
    Add some extra 'threads' debug in a couple of places in thread.c.
    I've also added an additional gdb_assert in one case.

Diff:
---
 gdb/thread.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/thread.c b/gdb/thread.c
index 378c5ee2d13..349fc01dd48 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -834,6 +834,10 @@ set_running_thread (struct thread_info *tp, bool running)
     started = true;
   tp->state = running ? THREAD_RUNNING : THREAD_STOPPED;
 
+  threads_debug_printf ("thread: %s, running? %d%s",
+			tp->ptid.to_string ().c_str (), running,
+			(started ? " (started" : ""));
+
   if (!running)
     {
       /* If the thread is now marked stopped, remove it from
@@ -1298,6 +1302,9 @@ info_threads_command_completer (struct cmd_list_element *ignore,
 void
 switch_to_thread_no_regs (struct thread_info *thread)
 {
+  gdb_assert (thread != nullptr);
+  threads_debug_printf ("thread = %s", thread->ptid.to_string ().c_str ());
+
   struct inferior *inf = thread->inf;
 
   set_current_program_space (inf->pspace);
@@ -1315,6 +1322,8 @@ switch_to_no_thread ()
   if (current_thread_ == nullptr)
     return;
 
+  threads_debug_printf ("thread = NONE");
+
   current_thread_ = nullptr;
   inferior_ptid = null_ptid;
   reinit_frame_cache ();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-10 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 11:19 [binutils-gdb] gdb: extra debug output in thread.c Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).