about
cygwin_stackdump()
:cygwin_stackdump()
creates a file named executable's plus suffixed.stackdump
.cygwin_stackdump()
writes simple stack trace which are constructed by frame,
function and args in hex notation.fopen()
stackdump file immediately aftercygwin_stackdump()
calling in signle
process will fail, so usefork()
andwaitpid()
.- cygwin has clang-3.1 as most recent version.
w/ 3.1, DWARF part looks broken, so unable to useaddr2line
to decode. - do not use
cygwin_stackdump()
for new code.
Christopher Faylor said:
'Exporting this function is an ancient mistake but we are stuck with
keeping it around to maintain backwards compatibility. There is
no guarantee that the stackdump you get from this is correct and
we have no plans on augmenting it further.'
http://cygwin.com/ml/cygwin/2014-01/msg00056.html cygwin_stackdump()
can not dump stack correctly in signal handler.
about
unwind.h
:For more general information about how to open STACKDUMP files, file extension stackdump and registry you can read one of the following articles: Windows registry - Windows registry is included in modern Windows operating systems to replace the older INI files which also contained system configuration.
- cygwin has clang-3.1 as most recent version.
w/ clang-3.1, DWARF part looks broken, so unable to useaddr2line
to decode.
w/ clang-3.1, only_Unwind_GetIP()
and_Unwind_Backtrace()
are supported.
as upstream version, see http://clang.llvm.org/doxygen/unwind_8h.html. - using
_Unwind_GetIP()
only via_Unwind_Backtrace()
, it can not dump stack
correctly in signal handler.
about signal handler:
SA_SIGINFO
is not supported properly on cygwin ATM.
according to_cygtls::call_signal_handler()
inwinsup/cygwin/exception.cc
,
the 3rd argument of signal handler is NULL even if SA_SIGINFO was set.
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/exceptions.cc?rev=1.432&content-type=text/x-cvsweb-markup&cvsroot=src
FYI, following code project looks promising:
http://www.codeproject.com/Articles/4225/Unix-ucontext_t-Operations-on-Windows-Platforms