MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxDebugLoop

Function fxDebugLoop

xs/sources/xsDebug.c:608–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608void fxDebugLoop(txMachine* the, txString path, txInteger line, txString message)
609{
610 txSlot* frame;
611 if (!fxIsConnected(the))
612 return;
613
614#ifdef mxInstrument
615 if (the->onBreak)
616 (the->onBreak)(the, 1);
617#endif
618#if defined(mxInstrument) || defined(mxProfile)
619 fxSuspendProfiler(the);
620#endif
621
622 fxEchoStart(the);
623 frame = the->frame;
624 do {
625 frame->flag &= ~XS_DEBUG_FLAG;
626 frame = frame->next;
627 } while (frame);
628 the->frame->flag |= XS_DEBUG_FLAG;
629 fxListFrames(the);
630 fxListLocal(the);
631 fxListGlobal(the);
632 fxListModules(the);
633 fxEcho(the, "<break");
634 frame = the->frame;
635 while (frame && !path) {
636 txSlot* environment = mxFrameToEnvironment(frame);
637 if (environment->ID != XS_NO_ID) {
638 path = fxGetKeyName(the, environment->ID);
639 line = environment->value.environment.line;
640 }
641 frame = frame->next;
642 }
643 if (path)
644 fxEchoPathLine(the, path, line);
645 fxEcho(the, "># Break: ");
646 if (!c_strcmp(message, "throw"))
647 fxEchoException(the, &mxException);
648 else
649 fxEchoString(the, message);
650 fxEcho(the, "!\n</break>");
651 fxEchoStop(the);
652
653 the->debugExit = 0;
654 the->debugModule = C_NULL;
655 while (fxIsConnected(the)) {
656 fxReceive(the);
657 fxDebugParse(the);
658 if ((the->debugState == XS_LF_STATE) && (the->debugExit > 1))
659 break;
660 }
661 mxHostInspectors.value.list.first = C_NULL;
662 mxHostInspectors.value.list.last = C_NULL;
663
664#if defined(mxInstrument) || defined(mxProfile)
665 fxResumeProfiler(the);

Callers 7

xsRun.cFile · 0.85
fxDebuggerFunction · 0.85
fxDebugLineFunction · 0.85
fxDebugThrowFunction · 0.85
fxReadableCallbackFunction · 0.85
fxMessageWindowProcFunction · 0.85
fxReadableCallbackFunction · 0.85

Calls 15

fxEchoStartFunction · 0.85
fxListFramesFunction · 0.85
fxListLocalFunction · 0.85
fxListGlobalFunction · 0.85
fxListModulesFunction · 0.85
fxEchoFunction · 0.85
fxGetKeyNameFunction · 0.85
fxEchoPathLineFunction · 0.85
fxEchoExceptionFunction · 0.85
fxEchoStringFunction · 0.85
fxEchoStopFunction · 0.85
fxDebugParseFunction · 0.85

Tested by

no test coverage detected