1 /* Copyright (c) 1982 Regents of the University of California */ 2 3 static char sccsid[] = "@(#)remake.c 1.1 01/18/82"; 4 5 /* 6 * Remake the object file from the source. 7 */ 8 9 #include "defs.h" 10 #include "command.h" 11 #include "object.h" 12 13 /* 14 * Invoke "pi" on the dotpfile, then reread the symbol table information. 15 * 16 * We have to save tracing info before, and read it in after, because 17 * it might contain symbol table pointers. 18 */ 19 20 remake() 21 { 22 char *tmpfile; 23 24 if (call("pi", stdin, stdout, dotpfile, NIL) == 0) { 25 if (strcmp(objname, "obj") != 0) { 26 call("mv", stdin, stdout, "obj", objname, NIL); 27 } 28 tmpfile = mktemp("/tmp/pdxXXXX"); 29 setout(tmpfile); 30 status(); 31 unsetout(); 32 bpfree(); 33 objfree(); 34 readobj(objname); 35 setinput(tmpfile); 36 unlink(tmpfile); 37 } else { 38 puts("pi unsuccessful"); 39 } 40 } 41