From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id B118C3840C09; Mon, 10 Oct 2022 11:19:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B118C3840C09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665400765; bh=QGHMxUv97YJDMVCYP1jBcQ6oxlbEwcmL9enlAEsFwZc=; h=From:To:Subject:Date:From; b=EKtrwgZ1ZjY5ndumezT1n9Svz4sPKFFvj2tSqxF6TEVtlMzQLtFmPJUGhcEqInVGk VL4PrhfBYn0rNpFbq3K2CkHj+DmJxjD1IT3zSyvpAwpPfyV/pt9Io8TcTHFCz9SgzA yFiJoPFeXy9yEr/7fGJVOaoLDeehuNpZ66JT26PI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: extra debug output in thread.c X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: adaef6569562ec0c3feb6144d0a420149906bf01 X-Git-Newrev: 58fd1204aa0f66dd2df30f673c9441e0265b8515 Message-Id: <20221010111925.B118C3840C09@sourceware.org> Date: Mon, 10 Oct 2022 11:19:25 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D58fd1204aa0f= 66dd2df30f673c9441e0265b8515 commit 58fd1204aa0f66dd2df30f673c9441e0265b8515 Author: Andrew Burgess Date: Mon Sep 5 16:56:35 2022 +0100 gdb: extra debug output in thread.c =20 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 runni= ng) started =3D true; tp->state =3D running ? THREAD_RUNNING : THREAD_STOPPED; =20 + 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_eleme= nt *ignore, void switch_to_thread_no_regs (struct thread_info *thread) { + gdb_assert (thread !=3D nullptr); + threads_debug_printf ("thread =3D %s", thread->ptid.to_string ().c_str (= )); + struct inferior *inf =3D thread->inf; =20 set_current_program_space (inf->pspace); @@ -1315,6 +1322,8 @@ switch_to_no_thread () if (current_thread_ =3D=3D nullptr) return; =20 + threads_debug_printf ("thread =3D NONE"); + current_thread_ =3D nullptr; inferior_ptid =3D null_ptid; reinit_frame_cache ();