[M3devel] processing stack/context

Jay K jay.krell at cornell.edu
Thu Dec 3 19:33:03 CET 2009


Tony, Understood, but you use the context as one end of the stack.

 

void
ThreadPThread__ProcessStopped (m3_pthread_t mt, char *bottom, char *context,
                               void (*p)(void *start, void *limit))
{
  /* process stack */
  if (stack_grows_down) {
    assert(context < bottom);
    p(context, bottom);   here
  } else {
    assert(bottom < context);
    p(bottom, context);            here 
  }
  /* process register context */
  p(context, context + sizeof(ucontext_t));
}


 

  - Jay

 


From: hosking at cs.purdue.edu
Date: Thu, 3 Dec 2009 10:05:33 -0500
To: jay.krell at cornell.edu
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] processing stack/context




Actually, in the latest version I explicitly process the signal context as well as the stack.


On 3 Dec 2009, at 06:09, Jay K wrote:

Tony, it looks like you assume the context passed to a signal handler is on the stack.
Is that really guaranteed? It couldn't be in some thread local for some reason?
 (signals can nest? Therefore that would be problematic?)
We can just use the address of a local, right?
 
And we can assume the signal stack is the regular stack?
By default?
(I know sigstack/sigaltstack can fiddle with it; we should assume it isn't used.)
 
I noticed this in structure ThreadWin32.m3 a bit more like ThreadPosix.m3.
 
 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091203/328d4cde/attachment-0002.html>


More information about the M3devel mailing list