From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-047.btinternet.com (mailomta32-re.btinternet.com [213.120.69.125]) by sourceware.org (Postfix) with ESMTPS id 3732F3858C52 for ; Wed, 21 Feb 2024 13:25:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3732F3858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3732F3858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=213.120.69.125 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708521947; cv=none; b=KPo/Sbb+L0jgs3y7jT8GJGjMxCYeSZJD8pW4T41F1gEYiIp0NNE2/S0fR2aRzmnIwfTNdHt/sE3eZvzt5yeSf+pZERgLbDKO5O3vbKbos0n6k4+Ro9gjKKkGw9MmZTN3OAGtyOo2ZZs8KCb8WoofE6KANnnzjTDsVkN7cSEH5x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708521947; c=relaxed/simple; bh=28Wsg2C0Q2WKzuvo8F8spQ8D9MZl+U3/pC7eGVfT2eo=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=wvcs/U9QAQU9b8E+par6RWntEJNutEuO2UFW9eWyyWybOnHZdPGEZPIl90EXakGqyJ/14q+hGF883zG+pauLyYkYnbmknsbWxRy/fs7gSy8tM9M/OgYIw8s/Zeoff8eJ3xvb6w+KogdFDrunyHtThrL4QtYzxFJ1Y46J+RwgT3g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-047.btinternet.com with ESMTP id <20240221132544.WMHK28253.re-prd-fep-047.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Wed, 21 Feb 2024 13:25:44 +0000 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 6577B87C08CA7376 X-Originating-IP: [81.129.146.194] X-OWM-Source-IP: 81.129.146.194 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrfedvgdehvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepvddvueehffeuvddthfevkeeifedvhfefteffvdduheekieegtedvteejteeiieelnecukfhppeekuddruddvledrudegiedrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddtlegnpdhinhgvthepkedurdduvdelrddugeeirdduleegpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopehguggsqdhprghttghhvghssehsohhurhgtvgifrghrvgdrohhrghdprhgtphhtthhopehpvggurhhosehprghlvhgvshdrnhgvthdprhgvvhfkrfephhhoshhtkeduqdduvdelqddugeeiqdduleegrdhrrghnghgvkeduqdduvdelrdgsthgtvghnthhrrghlphhluhhsrdgtohhmpdgruhhthhgpuhhsvghrpehjohhnthhurhhnvgihsegsthhinhhtvghrnhgvthdr tghomhdpghgvohfkrfepifeupdfovfetjfhoshhtpehrvgdqphhrugdqrhhgohhuthdqtddtge X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.109] (81.129.146.194) by re-prd-rgout-004.btmx-prd.synchronoss.net (authenticated as jonturney@btinternet.com) id 6577B87C08CA7376; Wed, 21 Feb 2024 13:25:43 +0000 Message-ID: Date: Wed, 21 Feb 2024 13:25:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] Rework Cygwin signal handling Content-Language: en-GB To: Pedro Alves , gdb-patches@sourceware.org References: <20240220165605.563516-1-pedro@palves.net> From: Jon Turney In-Reply-To: <20240220165605.563516-1-pedro@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 20/02/2024 16:56, Pedro Alves wrote: > This upstreams a couple GDB patches that Cygwin has been carrying > downstream. > > In my Windows non-stop work, I was having trouble with the > have_saved_context machinery, I couldn't get it to work properly. The > Cygwin distro gdb was able to unwind signals properly, but my GDB did > not. After some head banging, I realized that Cygwin gdb may have > some downstream patches. And indeed it does. One of those patches > eliminates the have_saved_context machinery... I got signal handling > and non-stop working properly on top of that patch, which then means > that I need that change upstream as well, if I am to upstream my > non-stop changes... So here we are. That patch is patch #2 in this > series. > > That have_saved_context patch depends on another downstream patch, > which is patch #1 here. The version I show here is a polished, > modernized version compared to the downstream version, but the main > logic is the same. While this is not perfect, it is certainly better > than what we have upstream, which just isn't able to unwind from a > signal handler at all. Cygwin has been carrying these patches for Thanks very much for polishing and modernising this patch. Just to note that the situation is even worse than noted here: as well as being unable to unwind in a signal handler, without this patch gdb also can't unwind from functions inside the cygwin DLL where the call stack passes through these wrappers (which is nearly all of them, which makes debugging problems there even more painful). Obviously, I am very much in favour of this being applied. :) > many years, so while we could think about improving all this, I see no > reason for holding back the patch as is. We can always improve on > top, and we should be able to do that upstream. > > Jon Turney (2): > Teach gdb how to unwind cygwin _sigbe and sigdelayed frames > Drop special way of getting inferior context after a Cygwin signal > > gdb/amd64-windows-tdep.c | 26 ++++++ > gdb/i386-windows-tdep.c | 20 ++++ > gdb/windows-nat.c | 52 +++-------- > gdb/windows-tdep.c | 194 +++++++++++++++++++++++++++++++++++++++ > gdb/windows-tdep.h | 20 ++++ > 5 files changed, 275 insertions(+), 37 deletions(-)