On Tue, May 03, 2011 at 09:56:35AM +0200, Corinna Vinschen wrote: >On May 2 16:11, Christopher Faylor wrote: >> On Mon, May 02, 2011 at 10:33:09AM -0500, Yaakov (Cygwin/X) wrote: >> >This implements pthread_attr_getstack(), pthread_attr_getstackaddr, and >> >pthread_getattr_np(), which I need for webkitgtk. >> > >> >In essence, I added a stackaddr member to pthread_attr, which is >> >accessed (slightly differently) by pthread_attr_getstack{,attr}, >> >behaving just as on Linux. The bulk of the work is to support >> >pthread_getattr_np, which provides the real attributes of the given >> >thread, including the real stack address and size. >> > >> >The pthread_attr_setstack{,addr} setters are not implemented, as I have >> >yet to find a way to set the thread stack address on Windows. For that >> >reason I'm not defining _POSIX_THREAD_ATTR_STACKADDR, as the feature is >> >not yet (fully) implemented. >> >> Cygwin already plays with the stack address. It has to for situations >> when you call fork() from a thread. > >Isn't that what GetThreadContext/SetThreadContext is for?
If you're just setting ebp/esp yes but you also have to mess around with the locations where Windows stores stack frame information. cgf