X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=auU0D/1RBGlKDkKJtQonrHCWid3jUp3gvHCGpNyPnQpp8SecdFhrE e/RJhAyf19cmyd6c2FRfLqGM2g0PK0sh+ctK1Zdd8mLpjrhMuzRHI2sKk/P5bw/6 35BnJWPvmYBYQhb9p00FgKLmYACiKcaevy1nlmpwE3Av5FZa0uoTdk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=qwxJXJyIUJPM602PjuKyF3hz/DY=; b=lAh28ffabuAeF0CQW7tz2Wa+Xa3z iirI/A12dq+hNgmpkaZ+eS7ZrxmC3QKXZmwpwHS5PBYPs5Ut/lgxC4zhIipblk1e QpiKFcWr+VblOIt7kDcPGyYzAiWQBeGYzQN4xr7lXkflvHOSqSvelQYXUfuwOJ/5 mqtnLqc7LGUynIc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Tue, 24 Feb 2015 22:16:39 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [PATCH] Teach gdb how to unwind cygwin _sigbe frames Message-ID: <20150224211639.GP437@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <1424715301-13516-1-git-send-email-jon DOT turney AT dronecode DOT org DOT uk> <20150223212427 DOT GB437 AT calimero DOT vinschen DOT de> <54EC98B4 DOT 9050003 AT dronecode DOT org DOT uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBMNUjqROSlRgKnE" Content-Disposition: inline In-Reply-To: <54EC98B4.9050003@dronecode.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) --gBMNUjqROSlRgKnE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Feb 24 15:28, Jon TURNEY wrote: > On 23/02/2015 21:24, Corinna Vinschen wrote: > >On Feb 23 18:15, Jon TURNEY wrote: > >>I really wanted to do this by adding some DWARF CFI to the generated si= gfe.s > >>file, but there doesn't seem to currently be a way to correctly describe > >>_sigbe's frame using that. > > > >I was wondering about this already. It seems weird if the CFI stuff > >doesn't allow for a situation like that >=20 > My understanding is limited, but it seems to me that it only describes > register unwinding, not unwinding the state of an arbitrary memory locati= on. >=20 > After writing my patch, which only unwinds one sigstack entry correctly, I > went back and had another go at writing the equivalent CFI, which I think > should be possible, but I still couldn't get it to work. >=20 > I'll take another look. Maybe the binutils folks can help? > >>So instead, write a custom unwinder for _sigbe frames, which gets the r= eturn > >>address from the sigstack. > >> > >>Implemented for i386 and amd64. > > > >Cool. Really. But, shouldn't that go to the gdb-patches mailing list? > > > >>4. This unfortunately ends up hardcoding into gdb the offset of sigstac= kptr in > >>the cygwin TLS area from the top of stack, and so will break if that ch= anges. > >>Hopefully that doesn't happen to often. > > > >It happens too often to be ignored. Wouldn't it make sense to add > >a cygwin_internal call to return tls offsets or addresses, the later > >if the argument is a pointer to the stack or cygtls area? >=20 > That's not going to give the right answer when remote debugging. Uh, good point. > But the offset is, of course, encoded into the _sigbe routine, so the bet= ter > approach is probably to extract it from there. You mean scanning the code and extracting the offset right from the opcodes? That's an... interesting... idea. I would probably object to it, but can't be bothered, considering Cygwin is doing the same with ntdll.dll ;) Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --gBMNUjqROSlRgKnE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU7Oo3AAoJEPU2Bp2uRE+gNPUP/2JMfEoKu66/jVI+r6tPQ2jz gYOkNUphBfOjp25NUwycefa2QiFdgy0hRRetUUAgj60ecr3fxBGPAYvr1Vip3ygi Z1RONArVPQULP5RI8KZyJlC06eCJLVeHh2dnMMuygltiOwxozrow0m1ALlZUuLzS Ydwvh5Rg0pYttBBHJYEXGSsEu4lEHpdlgB6N++TMGmtljdH4ykopQ0lusAiKqHfH 4l/xeLkIoA3dPhuxzIY8hZeEqF5iF1LftOcay2hCQG7rxHPBRWwohSI7bo/36SQq ydDa1Gmxg6clFDzVAv65Ls8xjFaiKb0ETMfrjINqo7lVuIjrwKPNJY1ofZoVTmAb RyG+mJr7IzV/nutQd7c90c4iByliKoOffZh/SctyPavpAvfJL7bbHS8vgJlefEkQ ZcQsKF/IphGdpXa/PGSJeIeB27Y0neEGDTYXeqsoWyN2mixJ6GxmliVcdBUiYXpH zM03lHcpScoBqBUBR4cx6+ae+iOB7bb1tDVKWLWixMOSgY76OlpNMrDbzCgTQDEk bYrSjPp88d5uc7b4JK39CJogsKkB8mVGTmrt47YbudxGFBDt4DB/85U15m5ZRP8w lKXBXdzxwh2qlaRob+zfWkRJACaTb30exZlG9jLZvZX0h+btXkWRveRr/EyOPyfv it0uPR7mzQ9Akr3YPTe7 =HIkH -----END PGP SIGNATURE----- --gBMNUjqROSlRgKnE--