delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/02/24/10:29:17

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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=JWeVZNiRO8TBuDQ9TJQ7JgQbdla59hyHDTLa0t5yiDO
isU9eWsypjQVq8JQVCfHU3xG2igW+dkmcLLCFFPLgtUmHStNNEDKXjzKApd/l7pw
2yfsmZqY6rcH82lpnYkAcSF2Ui5WtCmSoZXTPvPp9KJ/6kHN4QfI0K+ZMISDs8/4
=
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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=PZ+HLjX+K5YXEX5VGq21B8ilBGE=; b=BX7IA+OYVdvubvi9F
lCVDpS9g78RHl02ffBGmfJGzzksH1ZhP7yi/rvoWDF/1bRhS4FBJwb/FNoMpQ7Md
6a1ovcwSH42o+yALzA47jjfeI+2kWOIeOzhzkFHG5nLji+eyi/Mu4Z7PC8c/OFyL
70hZu4hPsTeKROEvpkesEbBd4Y=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2
X-HELO: out1-smtp.messagingengine.com
Message-ID: <54EC98B4.9050003@dronecode.org.uk>
Date: Tue, 24 Feb 2015 15:28:52 +0000
From: Jon TURNEY <jon DOT turney AT dronecode DOT org DOT uk>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [PATCH] Teach gdb how to unwind cygwin _sigbe frames
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>
In-Reply-To: <20150223212427.GB437@calimero.vinschen.de>

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 sigfe.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

My understanding is limited, but it seems to me that it only describes 
register unwinding, not unwinding the state of an arbitrary memory location.

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.

I'll take another look.

>> So instead, write a custom unwinder for _sigbe frames, which gets the return
>> 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 sigstackptr in
>> the cygwin TLS area from the top of stack, and so will break if that changes.
>> 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?

That's not going to give the right answer when remote debugging.

But the offset is, of course, encoded into the _sigbe routine, so the 
better approach is probably to extract it from there.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019