From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id ECBF23858D32 for ; Sun, 11 Sep 2022 18:55:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECBF23858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0B79D1E13B; Sun, 11 Sep 2022 14:55:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1662922541; bh=ZgUKMZErMsDIBrQYX2hKWlI9fywPHA6lJD8+dkeGJwk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=g2uMY4seZxQompMHQxXncngTbGq8JO6Ka/w+NAYqgRK1tkBzsSn/i0z1lBBddQqow C9VHFyLwEzYkk4wZABMcAw46XpO2/vV760chhQBdcI/Ch8VIDtaWF1+lH17l2OAAdH 84JGrOlN07XiTgE1o/u0aa085/jDmOn7v+XiPLPM= Message-ID: Date: Sun, 11 Sep 2022 14:55:40 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: Issues With Thread Events In User Mode GDBServer Content-Language: en-US To: Bill Messmer , "gdb@sourceware.org" References: From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-09-09 16:04, Bill Messmer via Gdb wrote: > Folks, > > Apologies if this is the wrong mailing list to ask a question regarding GDBServer / RSP and a potential bug. > > I have been working on new extensibility API surfaces for the Windows platform debuggers that allow folks to write plug-ins that can connect those debugging tools to a variety of new targets including ones that are not Windows based. We've had the ability to do this for post-mortem targets for some time and are, of late, working to expand that API surface to various forms of live targets. > > As proof of concept for the API surface, I've been experimenting with writing such a plug-in to connect to the standard user mode GDBServer for Linux. A few things I'll note: > > > 1. When thread events are enabled on the server via a QThreadEvents:1, GDBServer immediately crashes on any thread exit in "resume" on a NULL deref of current_thread. > > > > 1. I tried a quick patch here (adding "cs.last_status.kind() != TARGET_WAITKIND_THREAD_EXITED") to the set of conditions that won't set "current_thread->last_status" and the wXXX thread exit packets get sent; however, regardless of whether the target is in non-stop mode or not, the process is STILL RUNNING at the time the server sends the "wXXX" packet. > > > Am I missing something with GDBServer and thread events or is this just not well supported...? The process seems to be stopped at the point that a thread creation event gets sent... but not for a thread exit... I assume that's a bug somewhere in GDBServer...? Or am I misreading the docs at https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html...? Is there some alternate means by which thread create/exit notifications come...? > > Sincerely, > > Bill Messmer > wmessmer@microsoft.com Hi Bill, I don't quite understand the situation you are describing. Can you maybe send a log of the communication between your tool and GDBserver? Simon