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

Function fxBubble

xs/sources/xsDebug.c:2761–2809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2759#endif
2760
2761void fxBubble(txMachine* the, txInteger flags, void* message, txInteger length, txString conversation)
2762{
2763#ifdef mxDebug
2764 if (fxIsConnected(the)) {
2765 txString path = C_NULL;
2766 txInteger line = 0;
2767 txSlot* frame = the->frame;
2768 while (frame && !path) {
2769 txSlot* environment = mxFrameToEnvironment(frame);
2770 if (environment->ID != XS_NO_ID) {
2771 path = fxGetKeyName(the, environment->ID);
2772 line = environment->value.environment.line;
2773 }
2774 frame = frame->next;
2775 }
2776 fxEchoStart(the);
2777 fxEcho(the, "<bubble name=\"");
2778 if (conversation)
2779 fxEchoString(the, conversation);
2780 fxEcho(the, "\" value=\"");
2781 fxEchoInteger(the, flags);
2782 fxEcho(the, "\"");
2783 fxEchoPathLine(the, path, line);
2784 fxEcho(the, ">");
2785 if (flags & XS_BUBBLE_BINARY) {
2786 txU1* bytes = message;
2787 txInteger byteLength = length;
2788 while (byteLength) {
2789 txU1 byte = c_read8(bytes);
2790 fxEchoCharacter(the, gxHexaDigits[(byte & 0xF0) >> 4]);
2791 fxEchoCharacter(the, gxHexaDigits[(byte & 0x0F)]);
2792 bytes++;
2793 byteLength--;
2794 }
2795 }
2796 else
2797 fxEchoString(the, message);
2798 fxEcho(the, "</bubble>");
2799 fxEchoStop(the);
2800 }
2801#elif defined(mxInstrument)
2802 if (!(flags & XS_BUBBLE_BINARY)) {
2803 if (conversation)
2804 fxReport(the, "%s: %s\n", conversation, message);
2805 else
2806 fxReport(the, "%s\n", message);
2807 }
2808#endif
2809}
2810
2811void fxFileEvalString(txMachine* the, txString string, txString tag)
2812{

Callers 6

_xsbug_doneFunction · 0.85
_xsbug_mainFunction · 0.85
_xsbug_importFulfilledFunction · 0.85
_xsbug_importRejectedFunction · 0.85
_xsbug_script_Function · 0.85
fx_trace_auxFunction · 0.85

Calls 9

fxGetKeyNameFunction · 0.85
fxEchoStartFunction · 0.85
fxEchoFunction · 0.85
fxEchoStringFunction · 0.85
fxEchoIntegerFunction · 0.85
fxEchoPathLineFunction · 0.85
fxEchoCharacterFunction · 0.85
fxEchoStopFunction · 0.85
fxIsConnectedFunction · 0.70

Tested by

no test coverage detected