Package com.intellij.xdebugger

Examples of com.intellij.xdebugger.XSourcePosition


    }, "frame", Integer.toString(myId));
  }

  @Override
  public void customizePresentation(ColoredTextContainer component) {
    XSourcePosition position = getSourcePosition();
    component.append(myFunctionName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(" in ", SimpleTextAttributes.REGULAR_ATTRIBUTES);

    if (position != null) {
      component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
      component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
    else {
      component.append("<file name is not available>", SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
    component.setIcon(AllIcons.Debugger.StackFrame);
View Full Code Here


    myDebugProcess = process;

    myBreakpointHandlers = new XBreakpointHandler<?>[]{
      new XBreakpointHandler<XLineBreakpoint<XBreakpointProperties>>(HaxeBreakpointType.class) {
        public void registerBreakpoint(@NotNull final XLineBreakpoint<XBreakpointProperties> breakpoint) {
          final XSourcePosition position = breakpoint.getSourcePosition();
          if (position != null) {
            final String path =
              getRelativePath(myDebugProcess.getSession().getProject(), position.getFile());
            myDebugProcess.sendCommand(new AbstractResponseToRequestHandler<HXCPPResponse>() {
              @Override
              public boolean processResponse(HXCPPResponse response) {
                if (!response.getResponseString().contains("ok")) {
                  myDebugProcess.getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_invalid_breakpoint, null);
                  myDebugProcess.getSession().reportError("Cannot set exception breakpoint: " + response.getResponseString());
                  return true;
                }
                myBreakpointToIndexMap.put(breakpoint, id);
                myIndexToBreakpointMap.put(id, breakpoint);
                ++id;
                return true;
              }
            }, "break", path, Integer.toString(position.getLine() + 1));
          }
        }

        public void unregisterBreakpoint(@NotNull final XLineBreakpoint<XBreakpointProperties> breakpoint, final boolean temporary) {
          final Integer id = myBreakpointToIndexMap.remove(breakpoint);
View Full Code Here

        return DBProgramDebuggerEditorsProvider.INSTANCE;
    }

    @Override
    public String getDisplayText(XLineBreakpoint breakpoint) {
        XSourcePosition sourcePosition = breakpoint.getSourcePosition();
        if (sourcePosition != null ){
        VirtualFile file = sourcePosition.getFile();
        return XDebuggerBundle.message("xbreakpoint.default.display.text",
                breakpoint.getLine() + 1,
                file.getPresentableUrl());
        }
        return "unknown";
View Full Code Here

    node.addChildren(childrenList, true);
  }

  @Override
  public void customizePresentation(@NotNull ColoredTextContainer component) {
    final XSourcePosition position = getSourcePosition();

    if (myVmCallFrame.getFunctionName() != null) {
      component.append(DebuggerUtils.demangleVmName(myVmCallFrame.getFunctionName()), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }

    if (position != null) {
      final String text = " (" + position.getFile().getName() + ":" + (position.getLine() + 1) + ")";
      component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
    }
    else if (myLocationUrl != null) {
      component.append(" (" + myLocationUrl + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
    }
View Full Code Here

      }
    });
  }

  private void doRegisterBreakpoint(@NotNull final VmIsolate isolate, @NotNull final XLineBreakpoint<?> xBreakpoint) {
    final XSourcePosition position = xBreakpoint.getSourcePosition();
    if (position == null || position.getFile().getFileType() != DartFileType.INSTANCE) return;

    final String dartUrl = myDebugProcess.getDartUrlResolver().getDartUrlForFile(position.getFile());
    final int line = position.getLine() + 1;

    suspendVmPerformActionAndResume(isolate, new ThrowableRunnable<IOException>() {
      public void run() throws IOException {
        myDebugProcess.getVmConnection().setBreakpoint(isolate, dartUrl, line, new VmCallback<VmBreakpoint>() {
          @Override
View Full Code Here

      }
    });
  }

  private void doUnregisterBreakpoint(@NotNull final VmIsolate isolate, @NotNull final XLineBreakpoint<?> xBreakpoint) {
    final XSourcePosition position = xBreakpoint.getSourcePosition();
    if (position == null || position.getFile().getFileType() != DartFileType.INSTANCE) return;

    suspendVmPerformActionAndResume(isolate, new ThrowableRunnable<IOException>() {
      public void run() throws IOException {
        final Collection<VmBreakpoint> vmBreakpoints = myXBreakpointToVmBreakpoints.remove(xBreakpoint);
        if (vmBreakpoints != null) {
View Full Code Here

    XLineBreakpoint<?> breakpointAtLocation = null;

    for (XLineBreakpoint<?> xBreakpoint : myXBreakpoints) {
      doRegisterBreakpoint(isolate, xBreakpoint);

      final XSourcePosition sourcePosition = xBreakpoint.getSourcePosition();
      if (sourcePosition != null &&
          vmLocation != null &&
          sourcePosition.getLine() == locationLine - 1 &&
          vmLocation.getUnescapedUrl() != null &&
          sourcePosition.getFile().equals(myDebugProcess.getDartUrlResolver().findFileByDartUrl(vmLocation.getUnescapedUrl()))) {
        breakpointAtLocation = xBreakpoint;
      }
    }

    return breakpointAtLocation;
View Full Code Here

  private static void removeJSBreakpointsInDartFiles(final Project project) {
    final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
    final Collection<XBreakpoint<?>> toRemove = new ArrayList<XBreakpoint<?>>();

    for (XBreakpoint<?> breakpoint : breakpointManager.getAllBreakpoints()) {
      final XSourcePosition position = breakpoint.getSourcePosition();
      if (position != null &&
          position.getFile().getFileType() == DartFileType.INSTANCE &&
          !(breakpoint.getType() instanceof DartLineBreakpointType)) {
        toRemove.add(breakpoint);
      }
    }
View Full Code Here

        if (number != null) {
            // Re-enable the breakpoint
            m_gdb.sendCommand("-break-enable " + number);
        } else {
            // Set the breakpoint
            XSourcePosition sourcePosition = breakpoint.getSourcePosition();
            if (sourcePosition == null) {
                return;
            }

            String command = "-break-insert -f " + sourcePosition.getFile().getPath() + ":" + (sourcePosition.getLine() + 1);
            m_gdb.sendCommand(command, new Gdb.GdbEventCallback() {
                @Override
                public void onGdbCommandCompleted(GdbEvent event) {
                    onGdbBreakpointReady(event, breakpoint);
                }
View Full Code Here

                    SimpleTextAttributes.ERROR_ATTRIBUTES);
            return;
        }

        // Format the frame information
        XSourcePosition sourcePosition = getSourcePosition();
        if (m_frame.function != null) {
            // Strip any arguments from the function name
            String function = m_frame.function;
            int parenIndex = function.indexOf('(');
            if (parenIndex != -1) {
                function = function.substring(0, parenIndex);
            }

            if (sourcePosition != null) {
                component.append(function + "():" + (sourcePosition.getLine() + 1),
                        SimpleTextAttributes.REGULAR_ATTRIBUTES);
                component.append(" (" + sourcePosition.getFile().getName() + ")",
                        SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
            } else {
                component.append(function + "()", SimpleTextAttributes.GRAY_ATTRIBUTES);
                component.append(" (", SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
                if (m_frame.module != null) {
                    component.append(m_frame.module + ":",
                            SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
                }
                component.append("0x" + Long.toHexString(m_frame.address) + ")",
                        SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
            }
        } else if (sourcePosition != null) {
            component.append(
                    sourcePosition.getFile().getName() + ":" + (sourcePosition.getLine() + 1),
                    SimpleTextAttributes.REGULAR_ATTRIBUTES);
        } else {
            String addressStr = "0x" + Long.toHexString(m_frame.address);
            component.append(addressStr, SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
            component.appendFixedTextFragmentWidth(addressStr.length());
View Full Code Here

TOP

Related Classes of com.intellij.xdebugger.XSourcePosition

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.