use of org.eclipse.debug.core.model.IDebugTarget in project statecharts by Yakindu.
the class HighlightingSubmachineDecorationProvider method debugContextChanged.
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
PlatformObject object = (PlatformObject) ((IStructuredSelection) event.getContext()).getFirstElement();
if (object == null)
return;
IDebugTarget newTarget = (IDebugTarget) object.getAdapter(IDebugTarget.class);
if (newTarget != debugTarget && newTarget != null && !newTarget.isTerminated()) {
debugTarget = newTarget;
}
}
}
use of org.eclipse.debug.core.model.IDebugTarget in project webtools.sourceediting by eclipse.
the class ResultView method createPartControl.
@Override
public void createPartControl(Composite parent) {
this.sv = createViewer(parent);
// handle any launches already added
IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
for (IDebugTarget debugTarget : targets) {
if (debugTarget instanceof JAXPDebugTarget) {
handleDebugTarget((JAXPDebugTarget) debugTarget);
}
}
// listen to further launches
DebugPlugin.getDefault().addDebugEventListener(this);
}
use of org.eclipse.debug.core.model.IDebugTarget in project sling by apache.
the class JVMDebuggerConnection method stop.
public void stop(boolean force) {
IProcess[] processes = launch.getProcesses();
if (processes != null) {
for (int i = 0; i < processes.length; i++) {
IProcess iProcess = processes[i];
try {
iProcess.terminate();
} catch (DebugException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
IDebugTarget[] debugTargets = launch.getDebugTargets();
if (debugTargets != null) {
for (int i = 0; i < debugTargets.length; i++) {
IDebugTarget iDebugTarget = debugTargets[i];
try {
iDebugTarget.disconnect();
} catch (DebugException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
IDebugTarget dt = launch.getDebugTarget();
if (dt != null) {
try {
dt.disconnect();
} catch (DebugException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
use of org.eclipse.debug.core.model.IDebugTarget in project erlide_eclipse by erlang.
the class DebugTraceAsLaunchAction method selectionChanged.
@Override
public void selectionChanged(final IAction action, final ISelection selection) {
fTarget = null;
if (selection instanceof IStructuredSelection) {
final IStructuredSelection ss = (IStructuredSelection) selection;
for (final Object o : ss.toArray()) {
if (o instanceof IDebugTarget) {
final IDebugTarget target = (IDebugTarget) o;
fTarget = target;
break;
}
}
}
}
use of org.eclipse.debug.core.model.IDebugTarget in project erlide_eclipse by erlang.
the class ErlangProcess method setStackFrames.
public void setStackFrames(final String module, final int line, final OtpErlangList erlStackFrames, final OtpErlangList bs) {
stackFrames = new ArrayList<>();
final IDebugTarget target = getDebugTarget();
stackFrames.add(new ErlangStackFrame(module, this, target, line, null, bs, erlStackFrames.arity() + 2));
for (final OtpErlangObject o : erlStackFrames) {
final OtpErlangTuple t = (OtpErlangTuple) o;
final OtpErlangTuple mfa;
final OtpErlangObject el0 = t.elementAt(0);
final OtpErlangObject el1 = t.elementAt(1);
if (el0 instanceof OtpErlangTuple) {
mfa = (OtpErlangTuple) el0;
} else if (el1 instanceof OtpErlangTuple) {
mfa = (OtpErlangTuple) el1;
} else {
mfa = t;
}
int stackFrameNo;
final OtpErlangObject mfa0 = mfa.elementAt(0);
if (!(mfa0 instanceof OtpErlangAtom)) {
ErlLogger.debug("%s", mfa0);
}
final OtpErlangAtom m = (OtpErlangAtom) mfa0;
final OtpErlangLong l = (OtpErlangLong) t.elementAt(1);
final OtpErlangList bindings = (OtpErlangList) t.elementAt(2);
final OtpErlangLong n = (OtpErlangLong) t.elementAt(3);
int lin;
try {
lin = l.intValue();
} catch (final OtpErlangRangeException e) {
lin = -1;
}
final String mod = m.atomValue();
try {
stackFrameNo = n.intValue();
} catch (final OtpErlangRangeException e) {
stackFrameNo = -1;
}
stackFrames.add(new ErlangStackFrame(mod, this, target, lin, null, bindings, stackFrameNo));
}
}
Aggregations