Debugger - commands.
1.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/endpoint/EndPoint.java Tue Jan 28 22:26:21 2014 +0100
1.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/endpoint/EndPoint.java Wed Jan 29 14:22:48 2014 +0100
1.3 @@ -159,6 +159,7 @@
1.4 }
1.5
1.6 @CheckForNull
1.7 + @SuppressWarnings("unchecked")
1.8 private RequestHandler<Request, RequestKind> getHandleFor(@NonNull final Request query) {
1.9 final RequestKind kind = getRequestKind(query);
1.10 if (kind == null) {
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/AbstractCommandHandler.java Wed Jan 29 14:22:48 2014 +0100
2.3 @@ -0,0 +1,98 @@
2.4 +/*
2.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2.6 + *
2.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
2.8 + *
2.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
2.10 + * Other names may be trademarks of their respective owners.
2.11 + *
2.12 + * The contents of this file are subject to the terms of either the GNU
2.13 + * General Public License Version 2 only ("GPL") or the Common
2.14 + * Development and Distribution License("CDDL") (collectively, the
2.15 + * "License"). You may not use this file except in compliance with the
2.16 + * License. You can obtain a copy of the License at
2.17 + * http://www.netbeans.org/cddl-gplv2.html
2.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
2.19 + * specific language governing permissions and limitations under the
2.20 + * License. When distributing the software, include this License Header
2.21 + * Notice in each file and include the License file at
2.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
2.23 + * particular file as subject to the "Classpath" exception as provided
2.24 + * by Oracle in the GPL Version 2 section of the License file that
2.25 + * accompanied this code. If applicable, add the following below the
2.26 + * License Header, with the fields enclosed by brackets [] replaced by
2.27 + * your own identifying information:
2.28 + * "Portions Copyrighted [year] [name of copyright owner]"
2.29 + *
2.30 + * If you wish your version of this file to be governed by only the CDDL
2.31 + * or only the GPL Version 2, indicate your decision by adding
2.32 + * "[Contributor] elects to include this software in this distribution
2.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
2.34 + * single choice of license, a recipient has the option to distribute
2.35 + * your version of this file under either the CDDL, the GPL Version 2 or
2.36 + * to extend the choice of license to its licensees as provided above.
2.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
2.38 + * Version 2 license, then the option applies only if the new code is
2.39 + * made subject to such option by the copyright holder.
2.40 + *
2.41 + * Contributor(s):
2.42 + *
2.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
2.44 + */
2.45 +
2.46 +package org.netbeans.modules.dew4nb.services.debugger;
2.47 +
2.48 +import org.netbeans.api.annotations.common.NonNull;
2.49 +import org.netbeans.api.debugger.ActionsManager;
2.50 +import org.netbeans.api.debugger.Session;
2.51 +import org.netbeans.api.debugger.jpda.JPDADebugger;
2.52 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
2.53 +import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
2.54 +import org.netbeans.modules.dew4nb.endpoint.Status;
2.55 +import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
2.56 +import org.openide.util.Parameters;
2.57 +
2.58 +/**
2.59 + *
2.60 + * @author Tomas Zezula
2.61 + */
2.62 +abstract class AbstractCommandHandler extends BasicRequestHandler<DebugAction, DebugMessageType, ContinueResult> {
2.63 +
2.64 + public AbstractCommandHandler (@NonNull final DebugMessageType type) {
2.65 + super(DebugerModels.END_POINT, type, DebugAction.class, ContinueResult.class);
2.66 + }
2.67 +
2.68 + @Override
2.69 + @NonNull
2.70 + protected final Status handle(@NonNull final DebugAction request, @NonNull final ContinueResult response) {
2.71 + Parameters.notNull("request", request); //NOI18N
2.72 + Parameters.notNull("response", response); //NOI18N
2.73 + if (request.getType() != DebugMessageType.cont) {
2.74 + throw new IllegalStateException("Invalid message type: " + request.getType()); //NOI18N
2.75 + }
2.76 + Status status = Status.not_found;
2.77 + final int sessionId = request.getSession();
2.78 + final WorkspaceResolver.Context ctx = ActiveSessions.getInstance().getContext(sessionId);
2.79 + if (ctx != null) {
2.80 + final Session debugSession = ActiveSessions.getInstance().getDebugSession(sessionId);
2.81 + if (debugSession == null) {
2.82 + throw new IllegalStateException("No debugger session."); //NOI18N
2.83 + }
2.84 + final JPDADebugger jpda = debugSession.lookupFirst(null, JPDADebugger.class);
2.85 + if (!(jpda instanceof JPDADebuggerImpl)) {
2.86 + throw new IllegalStateException("Wrong debugger service."); //NOI18N
2.87 + }
2.88 + final ActionsManager actionsManager = debugSession.lookupFirst(null, ActionsManager.class);
2.89 + if (actionsManager == null) {
2.90 + throw new IllegalStateException("No ActionsManager."); //NOI18N
2.91 + }
2.92 + status = performAction(debugSession, (JPDADebuggerImpl)jpda, actionsManager);
2.93 + }
2.94 + return status;
2.95 + }
2.96 +
2.97 + abstract Status performAction(
2.98 + @NonNull Session session,
2.99 + @NonNull JPDADebuggerImpl jpda,
2.100 + @NonNull ActionsManager actionsManager);
2.101 +}
3.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ActiveSessions.java Tue Jan 28 22:26:21 2014 +0100
3.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ActiveSessions.java Wed Jan 29 14:22:48 2014 +0100
3.3 @@ -42,14 +42,24 @@
3.4
3.5 package org.netbeans.modules.dew4nb.services.debugger;
3.6
3.7 +import java.beans.Customizer;
3.8 +import java.beans.PropertyChangeEvent;
3.9 +import java.beans.PropertyChangeListener;
3.10 import java.util.concurrent.ConcurrentHashMap;
3.11 import java.util.concurrent.ConcurrentMap;
3.12 import java.util.concurrent.atomic.AtomicInteger;
3.13 +import java.util.logging.Level;
3.14 +import java.util.logging.Logger;
3.15 import org.netbeans.api.annotations.common.CheckForNull;
3.16 import org.netbeans.api.annotations.common.NonNull;
3.17 import org.netbeans.api.debugger.DebuggerManager;
3.18 import org.netbeans.api.debugger.Session;
3.19 +import org.netbeans.api.debugger.jpda.CallStackFrame;
3.20 +import org.netbeans.api.debugger.jpda.JPDADebugger;
3.21 +import org.netbeans.api.debugger.jpda.JPDAThread;
3.22 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
3.23 import org.netbeans.modules.dew4nb.endpoint.EndPoint;
3.24 +import org.netbeans.modules.dew4nb.endpoint.Status;
3.25 import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
3.26 import org.openide.util.Parameters;
3.27
3.28 @@ -59,6 +69,8 @@
3.29 */
3.30 final class ActiveSessions {
3.31
3.32 + private static final Logger LOG = Logger.getLogger(ActiveSessions.class.getName());
3.33 +
3.34 //@GuardedBy("ActiveSessions.class")
3.35 private static ActiveSessions instance;
3.36
3.37 @@ -78,7 +90,7 @@
3.38 Parameters.notNull("env", env); //NOI18N
3.39 final int id = sequencer.incrementAndGet();
3.40 final Session session = DebuggerManager.getDebuggerManager().getCurrentSession();
3.41 - if (active.putIfAbsent(id, new Data(context, env, session)) != null) {
3.42 + if (active.putIfAbsent(id, new Data(id, context, env, session)) != null) {
3.43 throw new IllegalStateException("Trying to reuse active session"); //NOI18N
3.44 }
3.45 return id;
3.46 @@ -111,23 +123,75 @@
3.47 return instance;
3.48 }
3.49
3.50 - private static final class Data {
3.51 + private static final class Data implements PropertyChangeListener {
3.52 + final int id;
3.53 final WorkspaceResolver.Context ctx;
3.54 final EndPoint.Env env;
3.55 final Session session;
3.56 + final JPDADebugger jpda;
3.57 + volatile JPDAThread currentThread;
3.58 +
3.59
3.60
3.61 private Data(
3.62 + final int id,
3.63 @NonNull final WorkspaceResolver.Context ctx,
3.64 @NonNull final EndPoint.Env env,
3.65 @NonNull final Session session) {
3.66 Parameters.notNull("ctx", ctx); //NOI18N
3.67 Parameters.notNull("env", env); //NOI18N
3.68 Parameters.notNull("session", session); //NOI18N
3.69 + this.id = id;
3.70 this.ctx = ctx;
3.71 this.env = env;
3.72 this.session = session;
3.73 + this.jpda = this.session.lookupFirst(null, JPDADebugger.class);
3.74 + if (!(jpda instanceof JPDADebuggerImpl)) {
3.75 + throw new IllegalStateException("Wrong debugger service."); //NOI18N
3.76 + }
3.77 + jpda.addPropertyChangeListener(this);
3.78 }
3.79 +
3.80 +
3.81 + @Override
3.82 + public void propertyChange(PropertyChangeEvent evt) {
3.83 + final String propName = evt.getPropertyName();
3.84 + if (JPDADebugger.PROP_CURRENT_THREAD.equals(propName)) {
3.85 + if (currentThread != null) {
3.86 + ((Customizer)currentThread).removePropertyChangeListener(this);
3.87 + }
3.88 + currentThread = jpda.getCurrentThread();
3.89 + if (currentThread != null) {
3.90 + ((Customizer)currentThread).addPropertyChangeListener(this);
3.91 + }
3.92 + } else if (JPDAThread.PROP_SUSPENDED.equals(propName)) {
3.93 + CallStackFrame[] callStack = null;
3.94 +// try {
3.95 +// callStack = currentThread.getCallStack();
3.96 +// } catch (Exception aie) {/*pass*/}
3.97 + if (callStack != null) {
3.98 + env.sendObject(createSuspendResult(callStack));
3.99 + } else {
3.100 + LOG.log(
3.101 + Level.WARNING,
3.102 + "No callstack for suspended thread: {0}", //NOI18N
3.103 + currentThread);
3.104 + }
3.105 + }
3.106 + }
3.107 +
3.108 + @NonNull
3.109 + private SuspendResult createSuspendResult(@NonNull CallStackFrame[] callStack) {
3.110 + final SuspendResult res = new SuspendResult();
3.111 + res.setId(id);
3.112 + res.setStatus(Status.done);
3.113 + res.setType(DebugMessageType.suspended);
3.114 + for (CallStackFrame csf : callStack) {
3.115 +
3.116 + }
3.117 + return res;
3.118 + }
3.119 +
3.120 }
3.121
3.122 }
4.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ContinueHandler.java Tue Jan 28 22:26:21 2014 +0100
4.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ContinueHandler.java Wed Jan 29 14:22:48 2014 +0100
4.3 @@ -43,13 +43,11 @@
4.4 package org.netbeans.modules.dew4nb.services.debugger;
4.5
4.6 import org.netbeans.api.annotations.common.NonNull;
4.7 +import org.netbeans.api.debugger.ActionsManager;
4.8 import org.netbeans.api.debugger.Session;
4.9 -import org.netbeans.api.debugger.jpda.JPDADebugger;
4.10 import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
4.11 -import org.netbeans.modules.dew4nb.endpoint.BasicRequestHandler;
4.12 import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
4.13 import org.netbeans.modules.dew4nb.endpoint.Status;
4.14 -import org.netbeans.modules.dew4nb.spi.WorkspaceResolver;
4.15 import org.openide.util.Parameters;
4.16 import org.openide.util.lookup.ServiceProvider;
4.17
4.18 @@ -58,36 +56,21 @@
4.19 * @author Tomas Zezula
4.20 */
4.21 @ServiceProvider(service=RequestHandler.class)
4.22 -public class ContinueHandler extends BasicRequestHandler<DebugAction, DebugMessageType, ContinueResult> {
4.23 +public final class ContinueHandler extends AbstractCommandHandler {
4.24
4.25 public ContinueHandler() {
4.26 - super(DebugerModels.END_POINT, DebugMessageType.cont, DebugAction.class, ContinueResult.class);
4.27 + super(DebugMessageType.cont);
4.28 }
4.29
4.30 @Override
4.31 - @NonNull
4.32 - protected Status handle(@NonNull final DebugAction request, @NonNull final ContinueResult response) {
4.33 - Parameters.notNull("request", request); //NOI18N
4.34 - Parameters.notNull("response", response); //NOI18N
4.35 - if (request.getType() != DebugMessageType.cont) {
4.36 - throw new IllegalStateException("Invalid message type: " + request.getType()); //NOI18N
4.37 - }
4.38 - Status status = Status.not_found;
4.39 - final int sessionId = request.getSession();
4.40 - final WorkspaceResolver.Context ctx = ActiveSessions.getInstance().getContext(sessionId);
4.41 - if (ctx != null) {
4.42 - final Session debugSession = ActiveSessions.getInstance().getDebugSession(sessionId);
4.43 - if (debugSession == null) {
4.44 - throw new IllegalStateException("No debugger session."); //NOI18N
4.45 - }
4.46 - final JPDADebugger jpda = debugSession.lookupFirst(null, JPDADebugger.class);
4.47 - if (!(jpda instanceof JPDADebuggerImpl)) {
4.48 - throw new IllegalStateException("Wrong debugger service."); //NOI18N
4.49 - }
4.50 - ((JPDADebuggerImpl)jpda).resume();
4.51 - status = Status.done;
4.52 - }
4.53 - return status;
4.54 + Status performAction(
4.55 + @NonNull final Session session,
4.56 + @NonNull final JPDADebuggerImpl jpda,
4.57 + @NonNull final ActionsManager actionsManager) {
4.58 + Parameters.notNull("session", session); //NOI18N
4.59 + Parameters.notNull("jpda", jpda); //NOI18N
4.60 + Parameters.notNull("actionsManager", actionsManager); //NOI18N
4.61 + jpda.resume();
4.62 + return Status.done;
4.63 }
4.64 -
4.65 }
5.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/DebugMessageType.java Tue Jan 28 22:26:21 2014 +0100
5.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/DebugMessageType.java Wed Jan 29 14:22:48 2014 +0100
5.3 @@ -49,5 +49,9 @@
5.4 public enum DebugMessageType {
5.5 attach,
5.6 breakpoints,
5.7 - cont
5.8 + cont,
5.9 + stepOver,
5.10 + stepIn,
5.11 + stepOut,
5.12 + suspended
5.13 }
6.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/DebugerModels.java Tue Jan 28 22:26:21 2014 +0100
6.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/DebugerModels.java Wed Jan 29 14:22:48 2014 +0100
6.3 @@ -90,10 +90,21 @@
6.4 @Property(name = "status", type = Status.class),
6.5 @Property(name = "type", type = DebugMessageType.class),
6.6 @Property(name = "state", type = String.class),
6.7 + @Property(name = "id", type = int.class)
6.8 })
6.9 static final class ContinueResultModel {
6.10 }
6.11
6.12 + @Model(className = "SuspendResult", properties = {
6.13 + @Property(name = "status", type = Status.class),
6.14 + @Property(name = "type", type = DebugMessageType.class),
6.15 + @Property(name = "id", type = int.class),
6.16 + @Property(name="stack", type = String.class, array = true)
6.17 + })
6.18 + static final class SuspendResultModel {
6.19 + }
6.20 +
6.21 +
6.22 @Model(className = "Context", properties = {
6.23 @Property(name="user", type=String.class),
6.24 @Property(name = "workspace", type = String.class),
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/StepInHandler.java Wed Jan 29 14:22:48 2014 +0100
7.3 @@ -0,0 +1,76 @@
7.4 +/*
7.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7.6 + *
7.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
7.8 + *
7.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7.10 + * Other names may be trademarks of their respective owners.
7.11 + *
7.12 + * The contents of this file are subject to the terms of either the GNU
7.13 + * General Public License Version 2 only ("GPL") or the Common
7.14 + * Development and Distribution License("CDDL") (collectively, the
7.15 + * "License"). You may not use this file except in compliance with the
7.16 + * License. You can obtain a copy of the License at
7.17 + * http://www.netbeans.org/cddl-gplv2.html
7.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
7.19 + * specific language governing permissions and limitations under the
7.20 + * License. When distributing the software, include this License Header
7.21 + * Notice in each file and include the License file at
7.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
7.23 + * particular file as subject to the "Classpath" exception as provided
7.24 + * by Oracle in the GPL Version 2 section of the License file that
7.25 + * accompanied this code. If applicable, add the following below the
7.26 + * License Header, with the fields enclosed by brackets [] replaced by
7.27 + * your own identifying information:
7.28 + * "Portions Copyrighted [year] [name of copyright owner]"
7.29 + *
7.30 + * If you wish your version of this file to be governed by only the CDDL
7.31 + * or only the GPL Version 2, indicate your decision by adding
7.32 + * "[Contributor] elects to include this software in this distribution
7.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
7.34 + * single choice of license, a recipient has the option to distribute
7.35 + * your version of this file under either the CDDL, the GPL Version 2 or
7.36 + * to extend the choice of license to its licensees as provided above.
7.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
7.38 + * Version 2 license, then the option applies only if the new code is
7.39 + * made subject to such option by the copyright holder.
7.40 + *
7.41 + * Contributor(s):
7.42 + *
7.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
7.44 + */
7.45 +
7.46 +package org.netbeans.modules.dew4nb.services.debugger;
7.47 +
7.48 +import org.netbeans.api.annotations.common.NonNull;
7.49 +import org.netbeans.api.debugger.ActionsManager;
7.50 +import org.netbeans.api.debugger.Session;
7.51 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
7.52 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
7.53 +import org.netbeans.modules.dew4nb.endpoint.Status;
7.54 +import org.openide.util.Parameters;
7.55 +import org.openide.util.lookup.ServiceProvider;
7.56 +
7.57 +/**
7.58 + *
7.59 + * @author Tomas Zezula
7.60 + */
7.61 +@ServiceProvider(service=RequestHandler.class)
7.62 +public class StepInHandler extends AbstractCommandHandler {
7.63 +
7.64 + public StepInHandler() {
7.65 + super(DebugMessageType.stepIn);
7.66 + }
7.67 +
7.68 + @Override
7.69 + Status performAction(
7.70 + @NonNull final Session session,
7.71 + @NonNull final JPDADebuggerImpl jpda,
7.72 + @NonNull final ActionsManager actionsManager) {
7.73 + Parameters.notNull("session", session); //NOI18N
7.74 + Parameters.notNull("jpda", jpda); //NOI18N
7.75 + Parameters.notNull("actionsManager", actionsManager); //NOI18N
7.76 + actionsManager.doAction(ActionsManager.ACTION_STEP_INTO);
7.77 + return Status.done;
7.78 + }
7.79 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/StepOutHandler.java Wed Jan 29 14:22:48 2014 +0100
8.3 @@ -0,0 +1,76 @@
8.4 +/*
8.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8.6 + *
8.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
8.8 + *
8.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
8.10 + * Other names may be trademarks of their respective owners.
8.11 + *
8.12 + * The contents of this file are subject to the terms of either the GNU
8.13 + * General Public License Version 2 only ("GPL") or the Common
8.14 + * Development and Distribution License("CDDL") (collectively, the
8.15 + * "License"). You may not use this file except in compliance with the
8.16 + * License. You can obtain a copy of the License at
8.17 + * http://www.netbeans.org/cddl-gplv2.html
8.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
8.19 + * specific language governing permissions and limitations under the
8.20 + * License. When distributing the software, include this License Header
8.21 + * Notice in each file and include the License file at
8.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
8.23 + * particular file as subject to the "Classpath" exception as provided
8.24 + * by Oracle in the GPL Version 2 section of the License file that
8.25 + * accompanied this code. If applicable, add the following below the
8.26 + * License Header, with the fields enclosed by brackets [] replaced by
8.27 + * your own identifying information:
8.28 + * "Portions Copyrighted [year] [name of copyright owner]"
8.29 + *
8.30 + * If you wish your version of this file to be governed by only the CDDL
8.31 + * or only the GPL Version 2, indicate your decision by adding
8.32 + * "[Contributor] elects to include this software in this distribution
8.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
8.34 + * single choice of license, a recipient has the option to distribute
8.35 + * your version of this file under either the CDDL, the GPL Version 2 or
8.36 + * to extend the choice of license to its licensees as provided above.
8.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
8.38 + * Version 2 license, then the option applies only if the new code is
8.39 + * made subject to such option by the copyright holder.
8.40 + *
8.41 + * Contributor(s):
8.42 + *
8.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
8.44 + */
8.45 +
8.46 +package org.netbeans.modules.dew4nb.services.debugger;
8.47 +
8.48 +import org.netbeans.api.annotations.common.NonNull;
8.49 +import org.netbeans.api.debugger.ActionsManager;
8.50 +import org.netbeans.api.debugger.Session;
8.51 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
8.52 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
8.53 +import org.netbeans.modules.dew4nb.endpoint.Status;
8.54 +import org.openide.util.Parameters;
8.55 +import org.openide.util.lookup.ServiceProvider;
8.56 +
8.57 +/**
8.58 + *
8.59 + * @author Tomas Zezula
8.60 + */
8.61 +@ServiceProvider(service=RequestHandler.class)
8.62 +public class StepOutHandler extends AbstractCommandHandler {
8.63 +
8.64 + public StepOutHandler() {
8.65 + super(DebugMessageType.stepOut);
8.66 + }
8.67 +
8.68 + @Override
8.69 + Status performAction(
8.70 + @NonNull final Session session,
8.71 + @NonNull final JPDADebuggerImpl jpda,
8.72 + @NonNull final ActionsManager actionsManager) {
8.73 + Parameters.notNull("session", session); //NOI18N
8.74 + Parameters.notNull("jpda", jpda); //NOI18N
8.75 + Parameters.notNull("actionsManager", actionsManager); //NOI18N
8.76 + actionsManager.doAction(ActionsManager.ACTION_STEP_OUT);
8.77 + return Status.done;
8.78 + }
8.79 +}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/StepOverHandler.java Wed Jan 29 14:22:48 2014 +0100
9.3 @@ -0,0 +1,76 @@
9.4 +/*
9.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9.6 + *
9.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
9.8 + *
9.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
9.10 + * Other names may be trademarks of their respective owners.
9.11 + *
9.12 + * The contents of this file are subject to the terms of either the GNU
9.13 + * General Public License Version 2 only ("GPL") or the Common
9.14 + * Development and Distribution License("CDDL") (collectively, the
9.15 + * "License"). You may not use this file except in compliance with the
9.16 + * License. You can obtain a copy of the License at
9.17 + * http://www.netbeans.org/cddl-gplv2.html
9.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
9.19 + * specific language governing permissions and limitations under the
9.20 + * License. When distributing the software, include this License Header
9.21 + * Notice in each file and include the License file at
9.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
9.23 + * particular file as subject to the "Classpath" exception as provided
9.24 + * by Oracle in the GPL Version 2 section of the License file that
9.25 + * accompanied this code. If applicable, add the following below the
9.26 + * License Header, with the fields enclosed by brackets [] replaced by
9.27 + * your own identifying information:
9.28 + * "Portions Copyrighted [year] [name of copyright owner]"
9.29 + *
9.30 + * If you wish your version of this file to be governed by only the CDDL
9.31 + * or only the GPL Version 2, indicate your decision by adding
9.32 + * "[Contributor] elects to include this software in this distribution
9.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
9.34 + * single choice of license, a recipient has the option to distribute
9.35 + * your version of this file under either the CDDL, the GPL Version 2 or
9.36 + * to extend the choice of license to its licensees as provided above.
9.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
9.38 + * Version 2 license, then the option applies only if the new code is
9.39 + * made subject to such option by the copyright holder.
9.40 + *
9.41 + * Contributor(s):
9.42 + *
9.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
9.44 + */
9.45 +
9.46 +package org.netbeans.modules.dew4nb.services.debugger;
9.47 +
9.48 +import org.netbeans.api.annotations.common.NonNull;
9.49 +import org.netbeans.api.debugger.ActionsManager;
9.50 +import org.netbeans.api.debugger.Session;
9.51 +import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl;
9.52 +import org.netbeans.modules.dew4nb.endpoint.RequestHandler;
9.53 +import org.netbeans.modules.dew4nb.endpoint.Status;
9.54 +import org.openide.util.Parameters;
9.55 +import org.openide.util.lookup.ServiceProvider;
9.56 +
9.57 +/**
9.58 + *
9.59 + * @author Tomas Zezula
9.60 + */
9.61 +@ServiceProvider(service=RequestHandler.class)
9.62 +public class StepOverHandler extends AbstractCommandHandler {
9.63 +
9.64 + public StepOverHandler() {
9.65 + super(DebugMessageType.stepOver);
9.66 + }
9.67 +
9.68 + @Override
9.69 + Status performAction(
9.70 + @NonNull final Session session,
9.71 + @NonNull final JPDADebuggerImpl jpda,
9.72 + @NonNull final ActionsManager actionsManager) {
9.73 + Parameters.notNull("session", session); //NOI18N
9.74 + Parameters.notNull("jpda", jpda); //NOI18N
9.75 + Parameters.notNull("actionsManager", actionsManager); //NOI18N
9.76 + actionsManager.doAction(ActionsManager.ACTION_STEP_OVER);
9.77 + return Status.done;
9.78 + }
9.79 +}