| Re: [cdt-dev] EDC and asynchronous operations |
Thanks to you and Eugene for helping me sort this out. John
Regarding 1: I don't understand what you mean. The following is simplified pseudo code that count number of frame on a stack by following a frame pointer list.
Boolean countStackFrames(Context ctx) {
TCFDataCache<Register> fp = lookupRegisterCI(ctx, REGISTER_FP);
if (!fp.validate(this)) {
fp.wait(this);
return false;
}
Address addr = fp.getData().valueAsAddress();
long count = 0;
while (addr != 0) {
TCFDataCache<Memory> mem = lookupMemoryCI(ctx, addr, address_size);
if (!mem.validate(this)) {
mem.wait(this);
return false;
}
addr = mem.getData().valueAsAddress();
count++;
}
set(null, null, count);
return true;
}