From: Lisa Hsu Date: Fri, 5 Mar 2004 13:16:33 +0000 (-0500) Subject: changes that affect post checkpoint runs. X-Git-Tag: m5_1.0_beta2~80 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34576de15a3c8f8a50437e5d95b1402722cf9e2b;p=gem5.git changes that affect post checkpoint runs. cpu/exec_context.cc: you can't delete an element of an array that you newed. oops. kern/tru64/tru64_events.cc: changes to reflect .ini changes, and also b/c es_intr and ipintr can happen at ANY point, even within a current calling path being tracked. sim/system.cc: can't delete an element of a newed array. must new them separately. --HG-- extra : convert_revision : 21573327b7b7f20bf9a3fcfb5854526433e17e17 --- diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc index 06bd741f2..776641202 100644 --- a/cpu/exec_context.cc +++ b/cpu/exec_context.cc @@ -147,14 +147,18 @@ ExecContext::unserialize(Checkpoint *cp, const std::string §ion) UNSERIALIZE_SCALAR(swCtx->calls); int size; UNSERIALIZE_SCALAR(size); - fnCall *call = new fnCall[size]; + + vector calls; + fnCall *call; for (int i=0; igetBin(call[i].name); + call = new fnCall; + paramIn(cp, section, csprintf("stackpos[%d]",i), call->name); + call->myBin = system->getBin(call->name); + calls.push_back(call); } for (int i=size-1; i>=0; --i) { - swCtx->callStack.push(&(call[i])); + swCtx->callStack.push(calls[i]); } } diff --git a/kern/tru64/tru64_events.cc b/kern/tru64/tru64_events.cc index e018cb242..a57c01841 100644 --- a/kern/tru64/tru64_events.cc +++ b/kern/tru64/tru64_events.cc @@ -130,7 +130,9 @@ FnEvent::process(ExecContext *xc) if (last->name == "idle_thread") ctx->calls++; - if (!xc->system->findCaller(myname(), last->name)) { + if (!xc->system->findCaller(myname(), "" ) && + !xc->system->findCaller(myname(), last->name)) { + DPRINTF(TCPIP, "but can't find parent %s\n", last->name); return; } diff --git a/sim/system.cc b/sim/system.cc index 951739462..43f43baec 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -164,26 +164,31 @@ System::unserialize(Checkpoint *cp, const std::string §ion) int numCtxs; UNSERIALIZE_SCALAR(numCtxs); - SWContext *ctxs = new SWContext[numCtxs]; + SWContext *ctx; Addr addr; int size; for(int i = 0; i < numCtxs; ++i) { + ctx = new SWContext; paramIn(cp, section, csprintf("Addr[%d]",i), addr); - paramIn(cp, section, csprintf("calls[%d]",i), ctxs[i].calls); + paramIn(cp, section, csprintf("calls[%d]",i), ctx->calls); paramIn(cp, section, csprintf("stacksize[%d]",i), size); - fnCall *call = new fnCall[size]; + + vector calls; + fnCall *call; for (int j = 0; j < size; ++j) { + call = new fnCall; paramIn(cp, section, csprintf("ctx[%d].stackpos[%d]",i,j), - call[j].name); - call[j].myBin = getBin(call[j].name); + call->name); + call->myBin = getBin(call->name); + calls.push_back(call); } for (int j=size-1; j>=0; --j) { - ctxs[i].callStack.push(&(call[j])); + ctx->callStack.push(calls[j]); } - addContext(addr, &(ctxs[i])); + addContext(addr, ctx); } } }