Put this function here so we can be reasonablly sure that "this" register and the 4 registers that may be used to pass args are on the stack.
| 134 | // Put this function here so we can be reasonablly sure that "this" register and |
| 135 | // the 4 registers that may be used to pass args are on the stack. |
| 136 | int RegisterCapture::Capture(int *inTopOfStack,int **inBuf,int &outSize,int inMaxSize, int *inBottom) |
| 137 | { |
| 138 | int size = ( (char *)inTopOfStack - (char *)inBottom )/sizeof(void *); |
| 139 | if (size>inMaxSize) |
| 140 | size = inMaxSize; |
| 141 | outSize = size; |
| 142 | if (size>0) |
| 143 | memcpy(inBuf,inBottom,size*sizeof(void*)); |
| 144 | return 1; |
| 145 | } |
| 146 | |
| 147 | |
| 148 | RegisterCapture *gRegisterCaptureInstance = 0; |