Examples of ICallerSideEvent


Examples of tod.core.database.event.ICallerSideEvent

        updateThis(result, isStepInto);
        this.fireLocalsChanged();
    }

    private void updateLocals(SearchResult result, boolean isStepInto) {
        ICallerSideEvent parentEvent;
        if (isStepInto) {
            parentEvent = result.lastEvent;
        } else {
            parentEvent = findParent(result);
        }

        // Update the method parameters
        updateParameters(result, parentEvent);
        IEventBrowser methodEvents;
        if (isStepInto) {
            methodEvents = this.getTODSession().getTODHandler().getStepIntoChildrenBrowser(parentEvent);
        } else {
            methodEvents = this.getTODSession().getTODHandler().getChildrenBrowser(parentEvent);
        }
        IBehaviorInfo parentBehavior = parentEvent.getOperationBehavior();
        System.out.println("Local variable scope: " + parentBehavior.getDeclaringType().getJvmName() + " - " + parentBehavior.getName() + parentBehavior.getSignature());
        IEventBrowser variableWrites = this.getTODSession().getTODHandler().filterLocalVariableWrites(methodEvents);
        ILogEvent target = result.lastEvent;
       
        if (!variableWrites.hasNext()) {
            return;
        }
       
        ILogEvent currentEvent;
        do {
            currentEvent = variableWrites.next();
           
            if (currentEvent instanceof LocalVariableWriteEvent) {
                LocalVariableWriteEvent lvw = (LocalVariableWriteEvent)currentEvent;
                String varName = lvw.getVariable().getVariableName();
                System.out.println("LOCAL: " + varName);
                if (eventInScope(lvw, target) && currentEvent.getDepth() == parentEvent.getDepth()+1) {
                    this.updateLocalVariable(lvw);
                }
            }
        } while (variableWrites.hasNext() && currentEvent.getDepth() == parentEvent.getDepth()+1);       
    }
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

            this.thisObject = null;
            return;
        }
       
        // The "target" of the current method is our "this" object.
        ICallerSideEvent parent;
        parent = findParent(result);
       
        // Our parent must be a method call.
        if (!(parent instanceof IBehaviorCallEvent)) {
            return;
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

   
    private boolean eventInScope(LocalVariableWriteEvent event, ILogEvent referenceEvent) {
        if (!(referenceEvent instanceof ICallerSideEvent)) {
            return false;
        }
        ICallerSideEvent reference = (ICallerSideEvent)referenceEvent;
        //LocalVariableInfo localInfo = event.getVariable();
        return reference.getDepth() == event.getDepth() &&
                reference.getOperationBehavior().equals(event.getOperationBehavior());
               
    }
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

        SearchResult result = new SearchResult();

        // Get the events from TOD.
        IEventBrowser newEvents = getTODSession().getTODHandler().getStepOverEventBrowser(thread);

        ICallerSideEvent event = null;
        ICallerSideEvent previousEvent = null;
        if (newEvents != null) {
            this.events = newEvents;
            // Move the event pointer past the last event we saw.
            if (lastEvent != null && runningLive) {
                events.setPreviousTimestamp(lastEvent.getTimestamp());
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

        LinkedList<ProgramStep> steps = new LinkedList<ProgramStep>();

        // The result we'll send back to our caller.
        SearchResult result = new SearchResult();

        ICallerSideEvent event = null;
        ICallerSideEvent previousEvent = null;
       
        ILogEvent ile;
        ICallerSideEvent validEvent = null;
        if (this.events != null && this.events.hasPrevious()) {
            // Go backwards. First, position the event log at the first line
            // we see that is NOT the line we are currently on.
            ILogEvent pointerEvent = null;
            do {
                ile = events.previous();
                if (depth != -1 && (computeDepth(ile) != depth && computeDepth(ile) != depth - 1)) {
                    continue;
                }
                if (ile instanceof ICallerSideEvent && !(ile instanceof BehaviorExitEvent)) {
                    event = (ICallerSideEvent)ile;
                    int lineNum = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
                    if (skippable(event) || lineNum == -1) {
                        continue;
                    }
                   
                    if (targetLine == -1 && lineNum != lineNumber) {
                        targetLine = lineNum;
                        pointerEvent = event;
                    } else if (targetLine != -1 && targetLine != lineNum) {
                        result.lastEvent = event;
                        break;
                    }
                }
            } while (events.hasPrevious());
            // Reset the event pointer to the first event on the target line.
            if (pointerEvent != null) {
                events.setNextTimestamp(pointerEvent.getTimestamp());
                ile = pointerEvent;
            }
            do {
                if (depth != -1 && computeDepth(ile) != depth && computeDepth(ile) != depth - 1) {
                    ile = events.previous();
                    continue;
                }
                if (ile instanceof ICallerSideEvent && !(ile instanceof BehaviorExitEvent)) {
                    if (!skippable(ile) && this.isEventOnLine(ile, targetLine)) {
                        previousEvent = event;
                        event = (ICallerSideEvent) ile;
                        int lineNum = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
                        if (lineNum != -1 ) {
                            validEvent = event;
                            ProgramStep step = ProgramStepFactory.stepFromTOD(this.getTODSession(), event, false, false);
                            if (step != null) {
                                steps.addLast(step);
                            }
                        }
                    } else if (!this.isEventOnLine(ile, targetLine)) {
                        break;
                    }
                }
                if (events.hasPrevious()) {
                    ile = events.previous();
                }
            } while (events.hasPrevious());
           

            // Don't skip any events! If the last event wasn't on this line,
            // go forward so that it will be seen again.
            if (!this.isEventOnLine(ile, targetLine)) {
                events.next();
            }
        }

        if (validEvent == null) {
            result.behavior = this.behavior; // TODO: might break
        } else {
            result.newLine = TypeUtils.calculateLineNumber(validEvent.getOperationBehavior(), validEvent.getOperationBytecodeIndex());
            result.targetEvent = validEvent;
            result.lastEvent = validEvent;
            result.behavior = validEvent.getOperationBehavior();
        }

        // Generate the conditional test event, if any.
        ProgramStep step = ProgramStepFactory.conditionalStep(session, event, lastLine, result.newLine, false);
        if (step != null) {
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

        SearchResult result = new SearchResult();

        // Get the events from TOD.
        IEventBrowser newEvents = getTODSession().getTODHandler().getStepOverEventBrowser(thread);

        ICallerSideEvent event = null;
        ICallerSideEvent previousEvent = null;
        if (newEvents != null) {
            this.events = newEvents;
            // Move the event pointer past the last event we saw.
            if (lastEvent != null && runningLive) {
                events.setPreviousTimestamp(lastEvent.getTimestamp());
            } else if (lastEvent != null) {
                events.setNextTimestamp(lastEvent.getTimestamp());
            }
        }

        // Have we found the start of the given location?
        if (this.events != null && this.events.hasNext()) {
            // Go forward
            do {
                ILogEvent ile = events.next();
                if (ile instanceof ICallerSideEvent) {
                    event = (ICallerSideEvent) ile;
                    if (skippable(event)) {
                        continue;
                    }
                   
                    // Is there a breakpoint, and should we stop at it?
                    if (hitBreakpoints && hasBreakpoint(event)) {
                        return makeSearchResult(event);
                    }
                   
                    if (isAtLocation(event, fullyQualifiedClassName, line)) {
                        previousEvent = event;
                    }
                }
            } while (events.hasNext() && !isAtLocation(event, fullyQualifiedClassName, line));
        }

        if (previousEvent == null) {
            result.behavior = null;
            result.newLine = -1;
            result.targetEvent = null;
        } else {
            result.targetEvent = previousEvent;
            result.behavior = previousEvent.getOperationBehavior();
            result.newLine = TypeUtils.calculateLineNumber(previousEvent.getOperationBehavior(), previousEvent.getOperationBytecodeIndex());
            result.lastEvent = event;
        }
       
        result.steps = (new LinkedList<ProgramStep>()).iterator();
        return result;
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

   
    private SearchResult stepBackToLine(String fullyQualifiedClassName, int line, boolean hitBreakpoints) {
        // The result we'll send back to our caller.
        SearchResult result = new SearchResult();

        ICallerSideEvent event = null;
        ICallerSideEvent previousEvent = null;
        // Have we found the start of the given location?
        if (this.events != null && this.events.hasPrevious()) {
            // Go backward
            do {
                ILogEvent ile = events.previous();
                if (ile instanceof ICallerSideEvent) {
                    event = (ICallerSideEvent) ile;
                    if (skippable(event)) {
                        continue;
                    }

                    // Is there a breakpoint, and should we stop at it?
                    if (hitBreakpoints && hasBreakpoint(event)) {
                        return makeSearchResult(event);
                    }
                   
                    if (isAtLocation(event, fullyQualifiedClassName, line)) {
                        previousEvent = event;
                    }
                }
            } while (events.hasPrevious() && !isAtLocation(event, fullyQualifiedClassName, line));
           
            do {
                ILogEvent ile = events.previous();
                if (ile instanceof ICallerSideEvent) {
                    event = (ICallerSideEvent) ile;
                    if (skippable(event)) {
                        continue;
                    }
                   
                    if (isAtLocation(event, fullyQualifiedClassName, line)) {
                        previousEvent = event;
                    }
                }
            } while (events.hasPrevious() && isAtLocation(event, fullyQualifiedClassName, line));
        }

        if (previousEvent == null) {
            result.behavior = event.getOperationBehavior();
            result.newLine = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
            result.targetEvent = event;
            result.lastEvent = event;
        } else {
            result.targetEvent = previousEvent;
            result.behavior = previousEvent.getOperationBehavior();
            result.newLine = TypeUtils.calculateLineNumber(previousEvent.getOperationBehavior(), previousEvent.getOperationBytecodeIndex());
            result.lastEvent = event;
        }
       
        result.steps = (new LinkedList<ProgramStep>()).iterator();
        return result;
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

            return result;
        }

        this.events = newEvents;

        ICallerSideEvent event = null;
        if (!this.events.hasNext()) {
            return result;
        }

        long lastTimestamp = this.events.getLastTimestamp();
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

        }
       
        if (!(event instanceof ICallerSideEvent)) {
            return false;
        }
        ICallerSideEvent callerEvent = (ICallerSideEvent)event;
       
        return TypeUtils.calculateLineNumber(callerEvent.getOperationBehavior(), callerEvent.getOperationBytecodeIndex()) == lineNumber;
    }
View Full Code Here

Examples of tod.core.database.event.ICallerSideEvent

            // Use either executedBehavior or calledBehavior, in that order, depending on which is available.
            IBehaviorInfo intendedBehavior = executedBehavior != null ? executedBehavior : calledBehavior;
            MethodInfo methodInfo = getTODSession().getClassInformationProvider().getMethodInfo(intendedBehavior);
            return !getTODSession().getFilter().acceptMethod(methodInfo);
        } else if (ile instanceof ICallerSideEvent) {
            ICallerSideEvent callerSideEvent = (ICallerSideEvent)ile;
            IBehaviorInfo operationBehavior = callerSideEvent.getOperationBehavior();
            if (operationBehavior == null) {
                return true;
            }
           
            // If it is something that occurred in java's SDK, ignore it.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.