122761Smckusick /* 222761Smckusick * Copyright (c) 1982 Regents of the University of California. 322761Smckusick * All rights reserved. The Berkeley software License Agreement 422761Smckusick * specifies the terms and conditions for redistribution. 522761Smckusick */ 65473Slinton 722761Smckusick #ifndef lint 8*47033Sdonn static char sccsid[] = "@(#)remake.c 5.2 (Berkeley) 03/06/91"; 922761Smckusick #endif not lint 105473Slinton 115473Slinton /* 125473Slinton * Remake the object file from the source. 135473Slinton */ 145473Slinton 155473Slinton #include "defs.h" 165473Slinton #include "command.h" 175473Slinton #include "object.h" 185473Slinton 195473Slinton /* 205473Slinton * Invoke "pi" on the dotpfile, then reread the symbol table information. 215473Slinton * 225473Slinton * We have to save tracing info before, and read it in after, because 235473Slinton * it might contain symbol table pointers. 246071Slinton * 256071Slinton * We also have to restart the process so that px dependent information 266071Slinton * is recomputed. 275473Slinton */ 285473Slinton 295473Slinton remake() 305473Slinton { 316071Slinton char *tmpfile; 325473Slinton 336071Slinton if (call("pi", stdin, stdout, dotpfile, NIL) == 0) { 346071Slinton if (strcmp(objname, "obj") != 0) { 356071Slinton call("mv", stdin, stdout, "obj", objname, NIL); 365473Slinton } 37*47033Sdonn tmpfile = mktemp(strdup("/tmp/pdxXXXX")); 386071Slinton setout(tmpfile); 396071Slinton status(); 406071Slinton unsetout(); 416071Slinton bpfree(); 426071Slinton objfree(); 436071Slinton initstart(); 446071Slinton readobj(objname); 456071Slinton setinput(tmpfile); 466071Slinton unlink(tmpfile); 476071Slinton } else { 486071Slinton puts("pi unsuccessful"); 496071Slinton } 505473Slinton } 51