I am using Tornado 2.2.1 and 82xx (PPC) architecture.
To practice the siglib (signal library) I downloaded from
http://rt.db.erau.edu/experiments/vx/signals/ signals.c and changed it a
little bit.
The code is attached below.

To activate it I run: sp sigGenerator

My problem is that I can not step over with the CrossWind (in task level
debugging mode) the task that is being signaled (function sigCatcher). Is
because this task is being interrupted by the signal handler ?

Is there a problem to debug a task that is being signaled ?
Martin Roth

Motorola Israel



/* includes */
#include "vxWorks.h"
#include "sigLib.h"
#include "taskLib.h"
#include "logLib.h"
#include "semLib.h"
#include "stdio.h"

/* function prototypes */
void catchSIGINT(int);
void sigCatcher(void);


/* globals */
#define NO_OPTIONS 0
#define ITER1 10000
#define LONG_TIME 60000000

int ownId;

SEM_ID semBin;



void sigGenerator(void) /* task to generate the SIGINT signal */
{
int i, j, taskId,taskId1 ;
STATUS taskAlive;


if((taskId =
taskSpawn("signal",101,0x100,20000,(FUNCPTR)sigCatcher,0,0,0,0,0,0,0 ,
0,0,0)) == ERROR)
printf("taskSpawn sigCatcher failed\n");


if ((semBin = semBCreate (SEM_Q_PRIORITY, SEM_EMPTY)) == NULL)
printf("taskSpawn semaphore failed\n");

ownId = taskIdSelf(); /* get sigGenerator's task id */

taskDelay(sysClkRateGet()); /* allow time to get sigCatcher to run */

for (i=0; i < ITER1; i++)
{
if ((taskAlive = taskIdVerify(taskId)) == OK)
{
printf("+++++++++++++++++++++++++++++++SIGINT sinal generated
%8.8X\n", tickGet());

kill(taskId, SIGINT); /* generate signal */

taskDelay(sysClkRateGet()/2); /* 0.5 sec */

}
else /* sigCatcher is dead */
break;
}
printf("\n***************sigGenerator Exited***************\n");
}


volatile int aa;
void sigCatcher(void) /* task to handle the SIGINT signal */
{
struct sigaction newAction;
int i, j;

newAction.sa_handler = catchSIGINT; /* set the new handler */
sigemptyset(&newAction.sa_mask); /* no other signals blocked */
newAction.sa_flags = NO_OPTIONS; /* no special options */

if(sigaction(SIGINT, &newAction, NULL) == -1)
printf("Could not install signal handler\n");

for (i=0; i < ITER1; i++)
{
for (j=0; j < LONG_TIME; j++) {
aa=5;
aa=6;
aa=7;
aa=j;
aa=aa-1;
}

printf("Normal processing in sigCatcher\n");
}

printf("\n+++++++++++++++sigCatcher Exited+++++++++++++++\n");
}


void catchSIGINT(int signal) /* signal handler code */
{


printf("-------------------------------SIGINT signal caught\n");

}