From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 823A93857359; Fri, 9 Sep 2022 13:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 823A93857359 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662730068; bh=kTxJ2Bka+txi1scV7Piec7PXpo069gEgtnkrbdSgLGg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ACwCCHb83QZLySjeBQmjFTDZoFpZ9XK1E62tLttiMuCTPnXnVPvxsClofGrFk+j0i F9AbNo6a0hG9JPQ+NsWc4Z/crFYBx/t6375FNMn4NWKqtynpX94F5IFp9pwt9bc9KW 75eTWArNRQRUwQq9eEyoHmXWRiunc2j14XBUk+3s= From: "luis.machado at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug remote/29538] Running "info threads" multiple times produce different output when target has been halted the entire time Date: Fri, 09 Sep 2022 13:27:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: remote X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luis.machado at arm dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29538 Luis Machado changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-09-09 Ever confirmed|0 |1 Status|UNCONFIRMED |WAITING CC| |luis.machado at arm dot com --- Comment #1 from Luis Machado --- Looking at the logs, it seems SEGGER's J-Link GDB server is at fault. First it reports an existing thread value of 0xdead (57005), which GDB acce= pts and adds to the list: [remote] Sending packet: $qfThreadInfo#bb [remote] Packet received: m0000dead [remote] Sending packet: $qsThreadInfo#c8 [remote] Packet received: l GDB asks for the thread list one more time: [remote] Sending packet: $qfThreadInfo#bb [remote] Packet received: m0000dead [remote] Sending packet: $qsThreadInfo#c8 [remote] Packet received: l Then GDB asks what is the current thread, and the remote replies empty: [remote] Sending packet: $qC#b4 [remote] Packet received: [remote] start_remote_1: warning: couldn't determine remote current threa= d; picking first in list. Now GDB is free to select whatever thread it wants, but there is only one, = so it selects 0xdead (57005). GDB attempts to list threads one more time, to which the remote replies with thread 0x0: [remote] Sending packet: $qfThreadInfo#bb [remote] Packet received: m00000000 [remote] Sending packet: $qsThreadInfo#c8 [remote] Packet received: l [threads] add_thread_silent: add thread to inferior 1, ptid 42000.0.0, targ= et remote [threads] new_thread: creating a new thread object, inferior 1, ptid 42000.= 0.0 [New Remote target] So GDB is confused. But it acknowledges that thread 0xdead (57005) is gone: The current thread has terminated. See `help thread'. $4 =3D "thread2" [Current thread is 1 (Thread 57005) (exited)] In the last error, I think GDB is still trying to hold on to the current th= read that has exited: Cannot execute this command without a live selected thread. I suppose you could switch threads and resume debugging from this point onwards. It seems SEGGER J-Link needs to report the current thread (even if it doesn= 't exist yet) and stick to its number until a "real" thread shows up. --=20 You are receiving this mail because: You are on the CC list for the bug.=