+
+ // HPCRIX contains the name of the file to send our dynamic runtime output to (a named pipe).
+
+ hpcRix = getenv("HPCRIX");
+ if (hpcRix) {
+ int comma;
+ Info *tmpModule;
+ int rixFD, rixCmdFD;
+
+ assert(hpc_inited);
+
+ if (sscanf(hpcRix,"%d:%d",&rixFD,&rixCmdFD) != 2) {
+ /* Bad format for HPCRIX.
+ */
+ fprintf(stderr,"Bad HPCRIX (%s)\n",hpcRix);
+ exit(0);
+ }
+
+#if DEBUG_HPC
+ fprintf(stderr,"found HPCRIX pipes: %d:%d\n",rixFD,rixCmdFD);
+#endif
+
+ rixFile = fdopen(rixFD,"w");
+ assert(rixFile != NULL);
+
+ rixCmdFile = fdopen(rixCmdFD,"r");
+ assert(rixCmdFile != NULL);
+
+ // If we fork a process, then we do not want ticks inside
+ // the sub-process to talk to the debugger. So we remember
+ // our pid at startup time, so we can check if we are still
+ // the original process.
+
+ debuggee_pid = getpid();
+
+ comma = 0;
+
+ fprintf(rixFile,"Starting %s\n",prog_name);
+ fprintf(rixFile,"[");
+ tmpModule = modules;
+ for(;tmpModule != 0;tmpModule = tmpModule->next) {
+ if (comma) {
+ fprintf(rixFile,",");
+ } else {
+ comma = 1;
+ }
+ fprintf(rixFile,"(\"%s\",%u)",
+ tmpModule->modName,
+ tmpModule->tickCount);
+#if DEBUG_HPC
+ fprintf(stderr,"(tracer)%s: %u (offset=%u)\n",
+ tmpModule->modName,
+ tmpModule->tickCount,
+ tmpModule->tickOffset);
+#endif
+ }
+ fprintf(rixFile,"]\n");
+ fflush(rixFile);
+
+ // Allocate the tixBox breakpoint array
+ // These are set to 1 if you want to
+ // stop at a specific breakpoint
+ tixBoxBP = (int *)calloc(1,sizeof(int));
+ }
+