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

Function fxSetBreakpoint

xs/sources/xsDebug.c:2576–2625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2574}
2575
2576void fxSetBreakpoint(txMachine* the, txString thePath, txInteger theLine, size_t theID)
2577{
2578 txID path;
2579 txSlot* breakpoint;
2580
2581 if (!thePath)
2582 return;
2583 if ((theID == 0) && (theLine == 0)) {
2584 if (!c_strcmp(thePath, "exceptions")) {
2585 the->breakOnExceptionsFlag = 1;
2586 mxPushUndefined();
2587 return;
2588 }
2589 if (!c_strcmp(thePath, "start")) {
2590 the->breakOnStartFlag = 1;
2591 mxPushUndefined();
2592 return;
2593 }
2594 }
2595 path = fxNewNameC(the, thePath);
2596 if (!path)
2597 return;
2598 breakpoint = mxBreakpoints.value.list.first;
2599 while (breakpoint) {
2600 if ((breakpoint->ID == path) && (breakpoint->value.breakpoint.line == theLine)) {
2601 break;
2602 }
2603 breakpoint = breakpoint->next;
2604 }
2605 if (!breakpoint) {
2606 breakpoint = fxNewSlot(the);
2607 breakpoint->next = mxBreakpoints.value.list.first;
2608 breakpoint->ID = path;
2609 breakpoint->kind = XS_BREAKPOINT_KIND;
2610 breakpoint->value.breakpoint.line = theLine;
2611 mxBreakpoints.value.list.first = breakpoint;
2612 }
2613 if (theID == 0) {
2614 mxPushUndefined();
2615 breakpoint->value.breakpoint.info = C_NULL;
2616 }
2617 else {
2618 txSlot* instance = fxNewInstance(the);
2619 txSlot* property = fxLastProperty(the, instance);
2620 property = fxNextUndefinedProperty(the, property, XS_NO_ID, XS_INTERNAL_FLAG);
2621 property = fxNextUndefinedProperty(the, property, XS_NO_ID, XS_INTERNAL_FLAG);
2622 property = fxNextUndefinedProperty(the, property, XS_NO_ID, XS_INTERNAL_FLAG);
2623 breakpoint->value.breakpoint.info = instance;
2624 }
2625}
2626
2627void fxSetBreakpointCondition(txMachine* the, txSlot* reference, txString it)
2628{

Callers 1

fxDebugPushTagFunction · 0.85

Calls 5

fxNewNameCFunction · 0.85
fxNewSlotFunction · 0.85
fxNewInstanceFunction · 0.85
fxLastPropertyFunction · 0.85
fxNextUndefinedPropertyFunction · 0.85

Tested by

no test coverage detected