示例#1
0
/* We make changes at post-fork */
static void postForkFunc(BPatch_thread *parent, BPatch_thread *child)
{
    //dprintf("in postForkFunc\n");
    /* For later identification */
    childThread = child;
    dprintf("Preparing tests on parent\n");
    prepareTestCase4(Parent_p, parent, PostFork);
    dprintf("Preparing tests on child\n");
    prepareTestCase4(Child_p,  child,  PostFork);
    dprintf("Fork handler finished (parent %p, child %p)\n", parent, child);
}
示例#2
0
static void initialPreparation(BPatch_thread *parent)
{
   //cerr << "in initialPreparation\n";
    assert(parent->getProcess()->isStopped());

   //cerr << "ok, inserting instr\n";
   prepareTestCase4(Parent_p, parent, PreFork);
}
示例#3
0
void prepareTests(procType proc_type, BPatch_thread *thread, forkWhen when)
{
  //cerr << "prepareTests, proc_type: " << proc_type << "\n";
  for(unsigned testNum=1; testNum<=MAX_TEST; testNum++) {
    //cerr << "testNum: " << testNum << "\n";
      if(! runTest[testNum] || passedTest[testNum]==false) continue;
      switch(testNum) {
	case 1:  prepareTestCase1(proc_type, thread, when);  break;
	case 2:  prepareTestCase2(proc_type, thread, when);  break;
	case 3:  prepareTestCase3(proc_type, thread, when);  break;
	case 4:  prepareTestCase4(proc_type, thread, when);  break;
	case 5:  prepareTestCase5(proc_type, thread, when);  break;
	case 6:  prepareTestCase6(proc_type, thread, when);  break;
	case 7:  prepareTestCase7(proc_type, thread, when);  break;
	case 8:  prepareTestCase8(proc_type, thread, when);  break;
	case 9:  prepareTestCase9(proc_type, thread, when);  break;
	default: 
	   fprintf(stderr, "prepareTest: Invalid test num type\n");
	   exit(0);
	   break;
      }
   }
}