| 606 | } |
| 607 | |
| 608 | void 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); |
no test coverage detected