tracing now prints instruction operands.

git-svn-id: svn://10.0.0.236/trunk@67479 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
2000-04-28 05:44:38 +00:00
parent 76df7ba704
commit b8602f2475
2 changed files with 26 additions and 4 deletions

View File

@@ -298,14 +298,25 @@ static float64 testFunctionCall(World &world, float64 n)
return result.f64;
}
/**
* Poor man's instruction tracing facility.
*/
class Tracer : public Context::Listener {
typedef InstructionStream::difference_type InstructionOffset;
void listen(Context* /*context*/, InstructionIterator pc,
JSValues* /*registers*/, ICodeModule* iCode)
JSValues* registers, ICodeModule* iCode)
{
InstructionOffset offset = (pc - iCode->its_iCode->begin());
printFormat(stdOut, "%04X: ", offset);
stdOut << **pc << '\n';
Instruction* i = *pc;
stdOut << *i;
if (i->count() > 0) {
stdOut << " [";
i->printOperands(stdOut, *registers);
stdOut << "]\n";
} else {
stdOut << '\n';
}
}
};

View File

@@ -298,14 +298,25 @@ static float64 testFunctionCall(World &world, float64 n)
return result.f64;
}
/**
* Poor man's instruction tracing facility.
*/
class Tracer : public Context::Listener {
typedef InstructionStream::difference_type InstructionOffset;
void listen(Context* /*context*/, InstructionIterator pc,
JSValues* /*registers*/, ICodeModule* iCode)
JSValues* registers, ICodeModule* iCode)
{
InstructionOffset offset = (pc - iCode->its_iCode->begin());
printFormat(stdOut, "%04X: ", offset);
stdOut << **pc << '\n';
Instruction* i = *pc;
stdOut << *i;
if (i->count() > 0) {
stdOut << " [";
i->printOperands(stdOut, *registers);
stdOut << "]\n";
} else {
stdOut << '\n';
}
}
};