MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / walkStack

Method walkStack

source/emulation/cpu/common/cpu.cpp:335–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void CPU::walkStack(U32 eip, U32 ebp, U32 indent) {
336 U32 moduleEip = this->thread->process->getModuleEip(this->seg[CS].address+eip);
337 BString name = this->thread->process->getModuleName(this->seg[CS].address+eip);
338 BString functionName;
339
340 if (name != "Unknown") {
341 //functionName = getFunctionName(name, moduleEip);
342 }
343 name = Fs::getFileNameFromPath(name);
344
345 std::vector<BString> parts;
346 functionName.split("\n", parts);
347 if (parts.size()) {
348 functionName = parts[0];
349 }
350 klog_fmt("%*s %-20s %-40s %08x / %08x", indent, "", name.length()?name.c_str():"Unknown", functionName.c_str(), eip, moduleEip);
351
352 ChangeThread c(this->thread);
353 if (this->memory->canRead(ebp, 8)) {
354 U32 prevEbp = memory->readd(ebp);
355 U32 returnEip = memory->readd(ebp+4);
356 if (prevEbp==0)
357 return;
358 walkStack(returnEip, prevEbp, indent);
359 }
360}
361
362void CPU::cpuid() {
363 CPU* cpu = this;

Callers 4

prepareFpuExceptionMethod · 0.95
prepareExceptionMethod · 0.95
printStackMethod · 0.80
logPageFaultMethod · 0.80

Calls 9

klog_fmtFunction · 0.85
getModuleEipMethod · 0.80
getModuleNameMethod · 0.80
splitMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45
canReadMethod · 0.45
readdMethod · 0.45

Tested by

no test coverage detected