gdb bt gives many question marks
Ryan Johnson
ryan.johnson@cs.utoronto.ca
Thu Mar 14 13:35:00 GMT 2013
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
More information about the Cygwin
mailing list