changes that affect post checkpoint runs.
authorLisa Hsu <hsul@eecs.umich.edu>
Fri, 5 Mar 2004 13:16:33 +0000 (08:16 -0500)
committerLisa Hsu <hsul@eecs.umich.edu>
Fri, 5 Mar 2004 13:16:33 +0000 (08:16 -0500)
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

cpu/exec_context.cc
kern/tru64/tru64_events.cc
sim/system.cc

index 06bd741f2c379b81ae8dde836759c8a0815f3c4d..7766412025bfce27bc2f145b23a734f4279e381e 100644 (file)
@@ -147,14 +147,18 @@ ExecContext::unserialize(Checkpoint *cp, const std::string &section)
         UNSERIALIZE_SCALAR(swCtx->calls);
         int size;
         UNSERIALIZE_SCALAR(size);
-        fnCall *call = new fnCall[size];
+
+        vector<fnCall *> calls;
+        fnCall *call;
         for (int i=0; i<size; ++i) {
-            paramIn(cp, section, csprintf("stackpos[%d]",i), call[i].name);
-            call[i].myBin = system->getBin(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]);
         }
 
     }
index e018cb242bc646de9472b8b4f7eca967d6f56446..a57c01841d5b6c2314020870a54787633dc5353f 100644 (file)
@@ -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;
         }
index 9517394626dc7631404f87e17c62e8df626f8fcd..43f43baecbb9a100e585a0f9bb9e2f8387e6f850 100644 (file)
@@ -164,26 +164,31 @@ System::unserialize(Checkpoint *cp, const std::string &section)
         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<fnCall *> 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);
         }
     }
 }