This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This is hard in C, and harder in code compiled by gcc due to things like -fomit-frame-pointer and gcc's tendency to use alloca under the hood for large stack allocations. This is nothing unique to cygwin, but it does mean that cygwin's stack dumper is unsafe to use because it may get something wrong and go to la-la-land. This seems to work ok-ish during error-before-abort but not for code that hopes to continue running reliably after the call.To complete the port of some library to Cygwin, I need a way to produce a traceback with as much info as possible. Currently I have something that works but not that well. There are basically 3 parts:
* Gather all the stack frames; see below. * Assign the PCs in each frame to some executable image; done via dlfcn. To be discussed later. * Convert the PCs to function+source+line; done via addr2line. Ditto.
Despite a lot of web digging I have not (yet?) found a better way than this classic unixish song-and-dance:
[... snipped source that manually parses output of forked child's call to cygwin_stackdump() ...]
Now this is acceptable for a traceback following the raising of some error condition, but seems much too heavy for using in a leak detector. Does anyone know of an equivalent API under cygwin? Or could we consider adding such a variation of cygwin_stackdump to the cygwin DLL?
-- 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
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |