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

Function fxDebugEval

xs/sources/xsDebug.c:249–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void fxDebugEval(txMachine* the, txSlot* frame, txString buffer, txInteger index)
250{
251 txSlot* result;
252 txSlot* expression;
253 mxHostInspectors.value.list.first = C_NULL;
254 mxHostInspectors.value.list.last = C_NULL;
255 mxTemporary(result);
256 mxTemporary(expression);
257 fxDebugEvalBuffer(the, buffer, expression);
258 if (fxDebugEvalExpression(the, frame, expression, result)) {
259 txInspectorNameList aList = { C_NULL, C_NULL };
260 fxEchoStart(the);
261 fxEcho(the, "<result line=\"");
262 fxEchoInteger(the, index);
263 fxEcho(the, "\">");
264 if (result->kind == XS_REFERENCE_KIND) {
265 txSlot* instance = result->value.reference;
266 txSlot* instanceInspector = fxToInstanceInspector(the, instance);
267 if (!instanceInspector)
268 fxToggle(the, instance);
269 fxEchoProperty(the, result, &aList, C_NULL, -1, C_NULL);
270 if (!instanceInspector)
271 fxToggle(the, instance);
272 }
273 else
274 fxEchoProperty(the, result, &aList, C_NULL, -1, C_NULL);
275 fxEcho(the, "</result>");
276 fxListLocal(the);
277 fxListGlobal(the);
278 fxListModules(the);
279 fxEchoStop(the);
280 }
281 else {
282 fxEchoStart(the);
283 fxEcho(the, "<result line=\"");
284 fxEchoInteger(the, index);
285 fxEcho(the, "\"># ");
286 fxEchoException(the, result);
287 fxEcho(the, "</result>");
288 fxListLocal(the);
289 fxListGlobal(the);
290 fxListModules(the);
291 fxEchoStop(the);
292 }
293 mxPop();
294 mxPop();
295}
296
297txU1* fxDebugEvalAtom(txMachine* the, txU1* p, Atom* atom, txString t)
298{

Callers 1

fxDebugPushTagFunction · 0.85

Calls 13

fxDebugEvalBufferFunction · 0.85
fxDebugEvalExpressionFunction · 0.85
fxEchoStartFunction · 0.85
fxEchoFunction · 0.85
fxEchoIntegerFunction · 0.85
fxToInstanceInspectorFunction · 0.85
fxToggleFunction · 0.85
fxEchoPropertyFunction · 0.85
fxListLocalFunction · 0.85
fxListGlobalFunction · 0.85
fxListModulesFunction · 0.85
fxEchoStopFunction · 0.85

Tested by

no test coverage detected