Package com.sun.jdi

Examples of com.sun.jdi.StackFrame


        LocalVariable var = (LocalVariable) method.variables().get( 0 );//frame

        ClassType frameType = (ClassType) var.type();

        StackFrame frame = getUnderlyingStackFrame();
        Value value = frame.getValue( var );
        //getThread().getTopStackFrame().get

        //IValue value = jdivar.getValue();
        ObjectReferenceImpl o = (ObjectReferenceImpl) value;
View Full Code Here


                                  -1 );
                }
                int newFrames = newSize - oldSize; // number of frames to create, if any
                int depth = oldSize;
                for ( int i = newFrames - 1; i >= 0; i-- ) {
                    StackFrame currentFrame = (StackFrame) frames.get( i );
                    JDIStackFrame customFrame = createCustomFrame( this,
                                                                   depth,
                                                                   currentFrame );

                    fStackFrames.add( 0,
                                      customFrame );

                    depth++;
                }
                int numToRebind = Math.min( newSize,
                                            oldSize ); // number of frames to attempt to rebind
                int offset = newSize - 1;
                for ( depth = 0; depth < numToRebind; depth++ ) {
                    DroolsStackFrame oldFrame = (DroolsStackFrame) fStackFrames.get( offset );
                    StackFrame frame = (StackFrame) frames.get( offset );
                    DroolsStackFrame newFrame = (DroolsStackFrame) oldFrame.bind( frame,
                                                                                  depth );
                    if ( newFrame != oldFrame ) {
                        fStackFrames.set( offset,
                                          newFrame );
View Full Code Here

        LocalVariable var = (LocalVariable) method.variables().get( 0 );//frame

        ClassType frameType = (ClassType) var.type();

        StackFrame frame = getUnderlyingStackFrame();
        Value value = frame.getValue( var );
        //getThread().getTopStackFrame().get

        //IValue value = jdivar.getValue();
        ObjectReferenceImpl o = (ObjectReferenceImpl) value;
View Full Code Here

        return getLast(eThread);
     
      eStackFrame=getLast(eThread).getStackFrame();
      }
   
    StackFrame stackFrame = frames.get(index);
   
    EStackFrameLocation ret=new EStackFrameLocation();
    ret.setStackFrame(eStackFrame);
    ret.setLineNumber(stackFrame.location().lineNumber());
   
    if(eStackFrame==null)
      {
      eStackFrame=new EStackFrame();
      ret.setStackFrame(eStackFrame);
      eStackFrame.setThread(eThread);
      eStackFrame.setDepth(frames.size()-index);
      eStackFrame.setMethod(createQueryMethod(stackFrame.location().method()));
     
      if(stackFrame.thisObject()!=null)
        eStackFrame.setThisObject(createQueryObjectReference(stackFrame.thisObject()));
     
      index++;
      if(index<frames.size())
        {
        eStackFrame.setPreviousStackFrameLocation(getStackFrameLocation(eThread, frames, index));
        }
     
      try
        {
        eStackFrame.setSourceName(stackFrame.location().sourceName());
        }
      catch (AbsentInformationException e)
        {
        System.out.println(e.getClass().getName() );
        }
View Full Code Here

      lastLocations.get(eThread.getName()).getDepth()==frames.size()-index)
      {
      return lastLocations.get(eThread.getName());
      }
   
    StackFrame stackFrame = frames.get(index);
    EStackFrame ret=new EStackFrame();
    ret.setThread(eThread);
    ret.setDepth(frames.size()-index);
    ret.setMethod(createQueryMethod(stackFrame.location().method()));
   
    if(stackFrame.thisObject()!=null)
      ret.setThisObject(createQueryObjectReference(stackFrame.thisObject()));
   
    index++;
    if(index<frames.size())
      {
      ret.setPreviousStackFrame(getStackFrame(eThread, frames, index));
View Full Code Here

    List<String> result = new ArrayList<String>();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    try {
      List<StackFrame> frames = threadRef.frames();
      for (int i=0; i<frames.size(); i++) {
        StackFrame frame = frames.get(i);
        Location loc = frame.location();
        String name = loc.declaringType().name() + "."
            + loc.method().name();
        String frameInfo = name + " line: " + loc.lineNumber();
        if (i == threadStack.getCurFrame()) {
          frameInfo = frameInfo + "  (current frame) ";
View Full Code Here

        value = vm.mirrorOf((String)obj);
      } else {
        value = (Value)obj;
      }
     
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      LocalVariable localVariable;
      localVariable = stackFrame.visibleVariableByName(name);
      if (localVariable != null) {
        stackFrame.setValue(localVariable, value);
      } else {
        ObjectReference thisObj = stackFrame.thisObject();
        if (thisObj == null) {
          return "can't find field or variable with name '"+name+"'";
        }
        ReferenceType refType = thisObj.referenceType();
        Field field = refType.fieldByName(name);
View Full Code Here

  public static String fields() {
    ThreadReference threadRef = checkAndGetCurrentThread();
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    StringBuilder sb = new StringBuilder();
    try {
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Map<Field, Value> values = thisObj.getValues(thisObj.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        fieldNames.add(field.name());
      }
View Full Code Here

 
  private static Value evalJdiVar(String name) {
    ThreadReference threadRef = checkAndGetCurrentThread();
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Value value = findValueInFrame(threadRef, name, thisObj);
      return value;
    } catch (IncompatibleThreadStateException e) {
      throw new ExpressionEvalException("eval expression error, caused by : " + e.getMessage());
    }
View Full Code Here

      ObjectReference thisObj)  {
   
    Value value = null;
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
     
      LocalVariable localVariable;
      localVariable = stackFrame.visibleVariableByName(name);
      if (localVariable != null) {
        return stackFrame.getValue(localVariable);
      }
     
      ReferenceType refType = stackFrame.location().declaringType();
      if (thisObj != null ) {
        refType = thisObj.referenceType();
      }
      Field field = refType.fieldByName(name);
      if (field == null ) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.StackFrame

Copyright © 2018 www.massapicom. 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.