Package org.eclipse.jdt.debug.core

Examples of org.eclipse.jdt.debug.core.IJavaThread


                ISelection stackSelection = debugContextService.getActiveContext();
                if (stackSelection instanceof IStructuredSelection) {
                    Object selection = ((IStructuredSelection) stackSelection).getFirstElement();
                    if (selection instanceof IJavaStackFrame) {
                        try {
                            IJavaThread thread = (IJavaThread) ((IJavaStackFrame) selection).getThread();
                            IStackFrame[] frames = thread.getStackFrames();
                            for (int i = 0; i < frames.length; i++) {
                                IJavaObject stackObj = ((IJavaStackFrame) frames[i]).getThis();
                                if ((stackObj != null)
                                        && (stackObj.getJavaType() != null)
                                        && ("org.drools.core.common.AbstractWorkingMemory".equals(stackObj.getJavaType().getName())
View Full Code Here


                ISelection stackSelection = debugContextService.getActiveContext();
                if (stackSelection instanceof IStructuredSelection) {
                    Object selection = ((IStructuredSelection) stackSelection).getFirstElement();
                    if (selection instanceof IJavaStackFrame) {
                        try {
                            IJavaThread thread = (IJavaThread) ((IJavaStackFrame) selection).getThread();
                            IStackFrame[] frames = thread.getStackFrames();
                            for (int i = 0; i < frames.length; i++) {
                                IJavaObject stackObj = ((IJavaStackFrame) frames[i]).getThis();
                                if ((stackObj != null)
                                        && (stackObj.getJavaType() != null)
                                        && ("org.drools.core.common.AbstractWorkingMemory".equals(stackObj.getJavaType().getName())
View Full Code Here

                ISelection stackSelection = debugContextService.getActiveContext();
                if (stackSelection instanceof IStructuredSelection) {
                    Object selection = ((IStructuredSelection) stackSelection).getFirstElement();
                    if (selection instanceof IJavaStackFrame) {
                        try {
                            IJavaThread thread = (IJavaThread) ((IJavaStackFrame) selection).getThread();
                            IStackFrame[] frames = thread.getStackFrames();
                            for (int i = 0; i < frames.length; i++) {
                                IJavaObject stackObj = ((IJavaStackFrame) frames[i]).getThis();
                                if ((stackObj != null)
                                        && (stackObj.getJavaType() != null)
                                        && ("org.drools.reteoo.ReteooStatefulSession".equals(stackObj.getJavaType().getName())
View Full Code Here

                ISelection stackSelection = debugContextService.getActiveContext();
                if (stackSelection instanceof IStructuredSelection) {
                    Object selection = ((IStructuredSelection) stackSelection).getFirstElement();
                    if (selection instanceof IJavaStackFrame) {
                        try {
                            IJavaThread thread = (IJavaThread) ((IJavaStackFrame) selection).getThread();
                            IStackFrame[] frames = thread.getStackFrames();
                            for (int i = 0; i < frames.length; i++) {
                                IJavaObject stackObj = ((IJavaStackFrame) frames[i]).getThis();
                                if ((stackObj != null)
                                        && (stackObj.getJavaType() != null)
                                        && ("org.drools.core.reteoo.ReteooStatefulSession".equals(stackObj.getJavaType().getName())
View Full Code Here

      ctx.resume();
      return Services.getMessage("debugging.session.resumed");
    } else {
      // Select the currently stepping thread if an empty thread ID is given.
      if (threadIdStr.isEmpty()) {
        IJavaThread steppingThread = (IJavaThread) threadCtx.getSteppingThread();
        if (steppingThread != null) {
          threadId = steppingThread.getThreadObject().getUniqueId();
        } else {
          return Services.getMessage("debugging.resume.thread.absent");
        }
      } else {
        threadId = Long.parseLong(threadIdStr);
View Full Code Here

   * If there is no such thread, then a <code>null</code> is returned.
   */
  public List<String> get()
    throws DebugException
  {
    IJavaThread thread = threadCtx.getSteppingThread();

    // Since the view is being reloaded, we can clear existing entries
    clear();

    if (thread == null) {
      return null;
    } else {
      this.viewingThread = thread;
      List<String> results = new ArrayList<String>();

      // Protect against variable information unavailable for native
      // methods
      try {
        IStackFrame stackFrame = thread.getTopStackFrame();
        if (stackFrame != null) {
          process(thread.getTopStackFrame().getVariables(), results, ROOT_DEPTH);
        }
      } catch (DebugException e) {
        // Suppress exception as it is possible to get an error when the current
        // stack frame points to native method. Variable information is not
        // available in this case.
View Full Code Here

   * Suspends the given thread.
   */
  public void suspend(long threadId)
    throws DebugException
  {
    IJavaThread thread = threadMap.get(threadId);
    if (thread != null) {
      thread.suspend();
    }
  }
View Full Code Here

   * Resumes execution of the given thread.
   */
  public void resume(long threadId)
    throws DebugException
  {
    IJavaThread thread = threadMap.get(threadId);
    if (thread != null) {
      thread.resume();
    }
  }
View Full Code Here

  {
    DebuggerContext ctx = DebuggerContextManager.getDefault();
    ThreadContext threadCtx = ctx.getThreadContext();

    String threadId = commandLine.getValue(Options.THREAD_ID_OPTION);
    IJavaThread steppingThread = null;
    if (threadId == null) {
      steppingThread = threadCtx.getSteppingThread();
    } else {
      steppingThread = threadCtx.getThread(Long.parseLong(threadId));
    }

    if (steppingThread == null) {
      return Services.getMessage("debugging.stepping.thread.absent");
    } else if (!steppingThread.isSuspended()) {
      return Services.getMessage("debugging.stepping.thread.not.suspended");
    }

    if (steppingThread != null) {
      // Set this thread to be the stepping thread
      threadCtx.setSteppingThread(steppingThread);
    }

    String action = commandLine.getValue(Options.ACTION_OPTION);

    if (action.equals(ACTION_INTO)) {
      steppingThread.stepInto();

    } else if (action.equals(ACTION_OVER)) {
      steppingThread.stepOver();

    } else if (action.equals(ACTION_RETURN)) {
      steppingThread.stepReturn();
    }

    return null;
  }
View Full Code Here

   * @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaObject exception = (IJavaObject) popValue();
    final IJavaThread javaThread = getContext().getThread();
    javaThread.stop(exception);
    javaThread.queueRunnable(new Runnable() {
      public void run() {
        try {
          javaThread.resume();
        } catch (DebugException e) {
          e.printStackTrace();
        }
      }
    });
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.debug.core.IJavaThread

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.