| 2574 | } |
| 2575 | |
| 2576 | void 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 | |
| 2627 | void fxSetBreakpointCondition(txMachine* the, txSlot* reference, txString it) |
| 2628 | { |
no test coverage detected