|
|
@ -59,7 +59,7 @@ static jmp_buf * ref_probe = &probe_samePC; /* switches between probes */
|
|
|
|
activation record on the heap *
|
|
|
|
activation record on the heap *
|
|
|
|
****/
|
|
|
|
****/
|
|
|
|
static int stack_direction; /* +1 if stack grows up, -1 if down */
|
|
|
|
static int stack_direction; /* +1 if stack grows up, -1 if down */
|
|
|
|
long int local_offset; /* lowest location in AR from local vars */
|
|
|
|
unsigned long int local_offset; /* lowest location in AR from local vars */
|
|
|
|
jmp_buf probe_record; /* nonzero entries mean fields that change */
|
|
|
|
jmp_buf probe_record; /* nonzero entries mean fields that change */
|
|
|
|
|
|
|
|
|
|
|
|
/****
|
|
|
|
/****
|
|
|
@ -116,7 +116,7 @@ static void studyit()
|
|
|
|
|
|
|
|
|
|
|
|
/* study the jump buffer */
|
|
|
|
/* study the jump buffer */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
unsigned long int i;
|
|
|
|
long int * p;
|
|
|
|
long int * p;
|
|
|
|
long int * sameAR;
|
|
|
|
long int * sameAR;
|
|
|
|
long int * samePC;
|
|
|
|
long int * samePC;
|
|
|
@ -169,7 +169,7 @@ static void studyit()
|
|
|
|
void thread_startup_report()
|
|
|
|
void thread_startup_report()
|
|
|
|
/* reports on the results of the study done by above code */
|
|
|
|
/* reports on the results of the study done by above code */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
unsigned long int i;
|
|
|
|
long int * jb;
|
|
|
|
long int * jb;
|
|
|
|
printf( "Thread startup study results\n" );
|
|
|
|
printf( "Thread startup study results\n" );
|
|
|
|
if (stack_direction == 1) {
|
|
|
|
if (stack_direction == 1) {
|
|
|
@ -177,16 +177,16 @@ void thread_startup_report()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
printf( " Stack grows down\n" );
|
|
|
|
printf( " Stack grows down\n" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf( " Local variable offset from AR base = %1d\n", local_offset );
|
|
|
|
printf( " Local variable offset from AR base = %1ld\n", local_offset );
|
|
|
|
printf( " Jump buffer fields subject to modification:\n" );
|
|
|
|
printf( " Jump buffer fields subject to modification:\n" );
|
|
|
|
jb = (long int *)probe_record;
|
|
|
|
jb = (long int *)probe_record;
|
|
|
|
for (i = 0; i < sizeof(jmp_buf); i += sizeof(long int) ) {
|
|
|
|
for (i = 0; i < sizeof(jmp_buf); i += sizeof(long int) ) {
|
|
|
|
if (*jb != 0) {
|
|
|
|
if (*jb != 0) {
|
|
|
|
printf( " %1d\n", i );
|
|
|
|
printf( " %1lu\n", i );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
jb++;
|
|
|
|
jb++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf( " Jump buffer size: %1d\n", sizeof(jmp_buf) );
|
|
|
|
printf( " Jump buffer size: %1lu\n", sizeof(jmp_buf) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****
|
|
|
|
/****
|
|
|
@ -365,7 +365,7 @@ void thread_launch( int size, void (* proc)(int), int param )
|
|
|
|
long int * probe_rec;
|
|
|
|
long int * probe_rec;
|
|
|
|
long int local_base = (long int)&t; /* address of local t */
|
|
|
|
long int local_base = (long int)&t; /* address of local t */
|
|
|
|
long int new_base;
|
|
|
|
long int new_base;
|
|
|
|
int i;
|
|
|
|
unsigned long int i;
|
|
|
|
|
|
|
|
|
|
|
|
/* the following code copies the contents of the
|
|
|
|
/* the following code copies the contents of the
|
|
|
|
activation record, just in case it might prove
|
|
|
|
activation record, just in case it might prove
|
|
|
|