delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/14/09:35:41

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <5141D1F5.9000207@cs.utoronto.ca>
Date: Thu, 14 Mar 2013 09:34:45 -0400
From: Ryan Johnson <ryan DOT johnson AT cs DOT utoronto DOT ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gdb bt gives many question marks
References: <603c2ab2 DOT 23bed DOT 13d67af2820 DOT Coremail DOT hgw00 AT 126 DOT com> <CAJH9Tsd+4ztE=OknKcUj=7CVefi3sSHiw6bvxPivuSFjgZ1Udg AT mail DOT gmail DOT com>
In-Reply-To: <CAJH9Tsd+4ztE=OknKcUj=7CVefi3sSHiw6bvxPivuSFjgZ1Udg@mail.gmail.com>
X-IsSubscribed: yes
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

On 14/03/2013 3:37 AM, Ken Huang wrote:
> Hi all,
>
> I have a problem when using gdb to debug my program in cygwin, the 'bt' command
> gives me many '??'.
>
> So I write a quite easy program named abort.c which just aborts. after
> compiled with
> "gcc -g abort.c -o abort" and run with " gdb abort", it aborts as
> expected. At this time
> I type "bt" in gdb to see the backtrace info, but it only gives the following:
<standard useless windows stack frames that have nothing to do with the 
actual cygwin program under debug>

My experience is that you're SOL once Windows has started its exception 
handling. I dont' know if it's an alternate stack, a debug info problem, 
or what; but the only reliable way I know to debug aborts is to `b 
__abort' so that gdb gets there before of Windows (I think it's two 
underscores, but it could be one or three).

Similar issues affect other signals. In particular, SIGSEGV can often 
leave you in this situation -- especially if the windows exception 
handler itself faulted (e.g. due to a corrupt stack). Unfortunately, 
there's not an easy function to put a breakpoint on that catches seg 
faults before they head into Windows land...

Ryan


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