Package com.sun.jdi

Examples of com.sun.jdi.Location


                throw new IllegalStateException( "MVELDebugHandler.onBreak cannot be found by JDI" );
            }
           
            Method method = list.get( 0 );
            if (method != null && !method.isNative()) {
                Location location = method.location();
                if (location != null && location.codeIndex() != -1) {
                    req = getEventRequestManager().createBreakpointRequest(location);
                    req.addThreadFilter( ((ClassPrepareEvent) event).thread() );
                    req.setSuspendPolicy( EventRequest.SUSPEND_ALL  );
                } else {
                    throw new IllegalStateException( "MVELDebugHandler.onBreak location cannot be found by JDI" );
View Full Code Here


    public final static synchronized DroolsStackFrame createCustomFrame(DroolsThread thread,
                                                                        int depth,
                                                                        StackFrame currentFrame) {
        DroolsStackFrame customFrame;
        Location loc = currentFrame.location();
        if ( loc.declaringType().name().equals( "org.drools.core.base.mvel.MVELDebugHandler" ) && loc.method().name().equals( "onBreak" ) ) {
            customFrame = new MVELStackFrame( thread,
                                              currentFrame,
                                              depth );
        } else {
            customFrame = new DroolsStackFrame( thread,
View Full Code Here

            for (Breakpoint bp : EditorFacade.getInstance().getBreakpoints()) {
              List<ReferenceType> list = vm.classesByName(bp.getClassName());
              if (list.size() > 0) {
                List<Method> mlist = list.get(0).methodsByName(bp.getMethodName(), bp.getMethodDesc().getRawDesc());
                if (mlist.size() > 0) {
                  Location loc = mlist.get(0).locationOfCodeIndex(bp.getPc());
                  BreakpointRequest bpr = vm.eventRequestManager().createBreakpointRequest(loc);
                  bpr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
                  bpr.setEnabled(true);
                } else {
                  logger.warning("Error, breakpoint " + bp + " method not found.");
View Full Code Here

    if (this.state == DebugState.ATTACHED) {
      List<ReferenceType> list = vm.classesByName(breakpoint.getClassName());
      if (list.size() > 0) {
        List<Method> mlist = list.get(0).methodsByName(breakpoint.getMethodName(), breakpoint.getMethodDesc().getRawDesc());
        if (mlist.size() > 0) {
          Location loc = mlist.get(0).locationOfCodeIndex(breakpoint.getPc());
          BreakpointRequest bpr = vm.eventRequestManager().createBreakpointRequest(loc);
          bpr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
          bpr.setEnabled(true);
        } else {
          logger.warning("Error, live breakpoint " + breakpoint + " method not found.");
View Full Code Here

              // set breakpoints
              for (Breakpoint bp : EditorFacade.getInstance().getBreakpoints()) {
                if (bp.getClassName().equals(cpe.referenceType().name())) {
                  List<Method> mlist = cpe.referenceType().methodsByName(bp.getMethodName(), bp.getMethodDesc().getRawDesc());
                  if (mlist.size() > 0) {
                    Location loc = mlist.get(0).locationOfCodeIndex(bp.getPc());
                    BreakpointRequest bpr = vm.eventRequestManager().createBreakpointRequest(loc);
                    bpr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
                    bpr.setEnabled(true);
                  } else {
                    logger.warning("Error, breakpoint " + bp + " method not found in EventHandler.");
View Full Code Here

    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) ";
        }
        result.add(frameInfo);
      }
View Full Code Here

        status = "SUSPENDED";
      }
      sb.append(status);
     
      if (ref.isAtBreakpoint()) {
        Location loc = ref.frame(0).location();
        sb.append("(breakpoint at line ");
        sb.append(loc.lineNumber());
        sb.append(" in ").append(loc.declaringType().name());
        sb.append(") ");
      }
      sb.append(")").append(" uniqueId : ").append(ref.uniqueID());
      sb.append("\n");
     
View Full Code Here

    }
    if (correctRef == null) return "no suspend thread";
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ReferenceType refType;
    try {
      Location loc = correctRef.frame(0).location();
      refType = loc.declaringType();
      threadStack.setCurRefType(refType);
      threadStack.setCurThreadRef(correctRef);
      changeVimEditSourceLocaton(loc);
      return "success";
    } catch (IncompatibleThreadStateException e) {
View Full Code Here

    ThreadReference threadRef = threadStack.getCurThreadRef();
    if (threadRef == null ) {
      return "no suspended thread";
    }
    try {
      Location loc = threadRef.frame(frameNum).location();
      ReferenceType refType= loc.declaringType();
      threadStack.setCurRefType(refType);
      threadStack.setCurFrame(frameNum);
      changeVimEditSourceLocaton(loc);
      return "success";
    } catch (IncompatibleThreadStateException e) {
View Full Code Here

      try {
        lines = rt.locationsOfLine(lineNum);
        if (lines.size() == 0) {
          continue;
        }
        Location loc = lines.get(0);
        BreakpointRequest request = vm.eventRequestManager().createBreakpointRequest(loc);
        request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
        request.setEnabled(true);
        breakpoint.addRequest(request);
      } catch (AbsentInformationException e) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.Location

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.