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]);
}
}
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;
}
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);
}
}
}