Debugger Client print feature

Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
This commit is contained in:
bence gabor kis 2020-03-31 14:24:07 +02:00 committed by Patrick Kim
commit e31cfeeada
14 changed files with 85 additions and 3 deletions

View file

@ -75,10 +75,15 @@ static bool stringEndsWith(const std::string& str, const std::string& suffix)
ValueRef* builtinPrint(ExecutionStateRef* state, ValueRef* thisValue, size_t argc, ValueRef** argv, bool isConstructCall)
{
if (argc >= 1) {
StringRef* printMsg;
if (argv[0]->isSymbol()) {
puts(argv[0]->asSymbol()->symbolDescriptiveString()->toStdUTF8String().data());
printMsg = argv[0]->asSymbol()->symbolDescriptiveString();
puts(printMsg->toStdUTF8String().data());
state->context()->printDebugger(printMsg);
} else {
puts(argv[0]->toString(state)->toStdUTF8String().data());
printMsg = argv[0]->toString(state);
puts(printMsg->toStdUTF8String().data());
state->context()->printDebugger(printMsg->toString(state));
}
} else {
puts("undefined");