2 /* Test application (Mutatee) */
8 #if defined(sparc_sun_sunos4_1_3) || defined(sparc_sun_solaris2_4)
11 #if defined(i386_unknown_nt4_0)
13 #define WIN32_LEAN_AND_MEAN
17 #if defined(sparc_sun_solaris2_4) || defined(i386_unknown_solaris2_5)
23 /* XXX Currently, there's a bug in the library that prevents a subroutine call
24 * instrumentation point from being recognized if it is the first instruction
25 * in a function. The following variable is used in this program in a number
26 * of kludges to get around this.
30 // control debug printf statements
31 #define dprintf if (debugPrint) printf
40 * Check to see if the mutator has attached to us.
49 * Stop the process (in order to wait for the mutator to finish what it's
50 * doing and restart us).
54 #ifdef i386_unknown_nt4_0
57 kill(getpid(), SIGSTOP);
62 void main(int argc, char *argv[])
66 int useAttach = FALSE;
68 for (i=1; i < argc; i++) {
69 if (!strcmp(argv[i], "-verbose")) {
71 } else if (!strcmp(argv[i], "-attach")) {
74 fprintf(stderr, "Usage: test2.mutatee [-attach] [-verbose]\n");
79 // see if we should wait for the attach
81 printf("Waiting for mutator to attach...\n");
82 while (!checkIfAttached()) ;
83 printf("Mutator attached. Mutatee continuing.\n");
86 #ifdef sparc_sun_solaris2_4
87 // now use the dlopen interface to force an object to load.
88 ref = dlopen(TEST_DYNAMIC_LIB, RTLD_NOW);
90 fprintf(stderr, "%s\n", dlerror());
94 // Stop and wait for the mutator to check that we linked the library