Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread dump for java debugger #5320

Merged
merged 50 commits into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e79881a
CHE-3708: Rename method getValue -> getString
Jan 16, 2017
26a1c72
CHE-3708: Variable.getValue() returns instance of SimpleValue instead…
Jan 16, 2017
65c4033
CHE-3708: Remove Variable.getVariables() method
Jan 17, 2017
3c35fce
Jdi classes implements model interfaces
Jan 17, 2017
3989395
Remove Variable.existsInformation method
Jan 17, 2017
c91483c
Introduce ThreadDump data model
Jan 17, 2017
7bb0d14
JDB threaddumps
Jan 18, 2017
36cab02
Merge master
Jun 9, 2017
42479fb
Fix up
tolusha Jun 13, 2017
2a19dd9
Fix tests
tolusha Jun 15, 2017
306afc7
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Jun 16, 2017
27a5a65
Refactoring
tolusha Jun 16, 2017
7ec32bb
Refactoring
tolusha Jun 19, 2017
efe4afb
Refactoring
tolusha Jun 19, 2017
9581075
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Jun 19, 2017
a93b45b
StackFrameDump
tolusha Jun 19, 2017
f98829e
CHE-4518: change styles for input boxes
olexii4 Jun 15, 2017
1a1166e
moved showIDE logic into the routeChange listener
olexii4 Jun 17, 2017
8d46461
CHE-5390: Fix bug when failed to commit renamed files (#5394)
vinokurig Jun 20, 2017
3581dd1
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Jun 21, 2017
ad15101
StackFrameDump
tolusha Jun 21, 2017
1bb2aaf
Fix up
tolusha Jul 17, 2017
993eabc
Java debugger server side part
tolusha Aug 16, 2017
cd12081
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Aug 16, 2017
5aa3983
Fix up
tolusha Aug 16, 2017
8ac3ddf
FixUp
tolusha Aug 18, 2017
70b4d14
Fix tests
tolusha Aug 18, 2017
d9b81bd
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Aug 18, 2017
1c55a76
Client side part
tolusha Aug 18, 2017
ff5b5d4
Debugger Resource Handler
tolusha Aug 19, 2017
1bebe3a
FixUP
tolusha Aug 19, 2017
bd7a558
Fix up
tolusha Aug 19, 2017
cb69988
Fix up
tolusha Aug 19, 2017
ac282ed
Fix up
tolusha Aug 19, 2017
47570ec
Fix up
tolusha Aug 21, 2017
a1018f0
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Aug 21, 2017
eefdc75
Fix up
tolusha Aug 21, 2017
2d33bd9
Refactoring
tolusha Aug 23, 2017
63b3f87
Rename ThreadDump model class to ThreadState
tolusha Aug 23, 2017
7bbc09c
Fix up
tolusha Aug 23, 2017
1c2d4ab
Refactoring
tolusha Sep 6, 2017
ed918da
Fix up
tolusha Sep 7, 2017
f0a96cc
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Sep 7, 2017
f36d607
Fix up
tolusha Sep 7, 2017
11fabb0
Fix tests
tolusha Sep 11, 2017
01fe41c
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Sep 11, 2017
aa30693
Add selenium test
tolusha Sep 12, 2017
0eaacfc
Merge remote-tracking branch 'origin/master' into CHE-3708
tolusha Sep 12, 2017
89c264e
Fix up
tolusha Sep 13, 2017
08ab0c7
Fix up
tolusha Sep 13, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.che.api.debug.shared.dto.LocationDto;
import org.eclipse.che.api.debug.shared.dto.SimpleValueDto;
import org.eclipse.che.api.debug.shared.dto.StackFrameDumpDto;
import org.eclipse.che.api.debug.shared.dto.ThreadDumpDto;
import org.eclipse.che.api.debug.shared.dto.VariableDto;
import org.eclipse.che.api.debug.shared.dto.action.ResumeActionDto;
import org.eclipse.che.api.debug.shared.dto.action.StartActionDto;
Expand Down Expand Up @@ -104,11 +105,20 @@ public interface DebuggerServiceClient {
Promise<List<BreakpointDto>> getAllBreakpoints(String id);

/**
* Gets dump of fields and local variables of the current frame.
* Gets the stack frame dump.
*
* @param id debug session id
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<StackFrameDumpDto> getStackFrameDump(String id);
Promise<StackFrameDumpDto> getStackFrameDump(String id, long threadId, int frameIndex);

/**
* Gets thread dump.
*
* @param id debug session id
*/
Promise<List<ThreadDumpDto>> getThreadDump(String id);

/**
* Resumes application.
Expand All @@ -118,18 +128,23 @@ public interface DebuggerServiceClient {
Promise<Void> resume(String id, ResumeActionDto action);

/**
* Returns a value of the variable.
* Returns a value of the variable in the specific frame.
*
* @param id debug session id
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<SimpleValueDto> getValue(String id, VariableDto variableDto);
Promise<SimpleValueDto> getValue(
String id, VariableDto variableDto, long threadId, int frameIndex);

/**
* Sets the new value of the variable.
* Sets the new value of the variable in the specific frame.
*
* @param id debug session id
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<Void> setValue(String id, VariableDto variableDto);
Promise<Void> setValue(String id, VariableDto variableDto, long threadId, int frameIndex);

/**
* Does step into.
Expand All @@ -156,10 +171,12 @@ public interface DebuggerServiceClient {
Promise<Void> stepOut(String id, StepOutActionDto action);

/**
* Evaluate the expression.
* Evaluate the expression inside specific frame.
*
* @param id debug session id
* @param expression the expression to evaluate
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<String> evaluate(String id, String expression);
Promise<String> evaluate(String id, String expression, long threadId, int frameIndex);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.eclipse.che.api.debug.shared.dto.LocationDto;
import org.eclipse.che.api.debug.shared.dto.SimpleValueDto;
import org.eclipse.che.api.debug.shared.dto.StackFrameDumpDto;
import org.eclipse.che.api.debug.shared.dto.ThreadDumpDto;
import org.eclipse.che.api.debug.shared.dto.VariableDto;
import org.eclipse.che.api.debug.shared.dto.action.ActionDto;
import org.eclipse.che.api.debug.shared.dto.action.ResumeActionDto;
Expand Down Expand Up @@ -130,27 +131,37 @@ public Promise<Void> deleteAllBreakpoints(String id) {
}

@Override
public Promise<StackFrameDumpDto> getStackFrameDump(String id) {
final String requestUrl = getBaseUrl(id) + "/dump";
public Promise<StackFrameDumpDto> getStackFrameDump(String id, long threadId, int frameIndex) {
final String requestUrl =
getBaseUrl(id) + "/stackframedump?thread=" + threadId + "&frame=" + frameIndex;
return asyncRequestFactory
.createGetRequest(requestUrl)
.send(dtoUnmarshallerFactory.newUnmarshaller(StackFrameDumpDto.class));
}

@Override
public Promise<List<ThreadDumpDto>> getThreadDump(String id) {
final String requestUrl = getBaseUrl(id) + "/threaddump";
return asyncRequestFactory
.createGetRequest(requestUrl)
.send(dtoUnmarshallerFactory.newListUnmarshaller(ThreadDumpDto.class));
}

@Override
public Promise<Void> resume(String id, ResumeActionDto action) {
return performAction(id, action);
}

@Override
public Promise<SimpleValueDto> getValue(String id, VariableDto variableDto) {
final String requestUrl = getBaseUrl(id) + "/value";
public Promise<SimpleValueDto> getValue(
String id, VariableDto variableDto, long threadId, int frameIndex) {
final String requestUrl = getBaseUrl(id) + "/value?thread=" + threadId + "&frame=" + frameIndex;
List<String> path = variableDto.getVariablePath().getPath();

StringBuilder params = new StringBuilder();
for (int i = 0; i < path.size(); i++) {
params.append(i == 0 ? "?" : "&");
params.append("path");

params.append("&path");
params.append(i);
params.append("=");
params.append(path.get(i));
Expand All @@ -162,8 +173,8 @@ public Promise<SimpleValueDto> getValue(String id, VariableDto variableDto) {
}

@Override
public Promise<Void> setValue(String id, VariableDto variableDto) {
final String requestUrl = getBaseUrl(id) + "/value";
public Promise<Void> setValue(String id, VariableDto variableDto, long threadId, int frameIndex) {
final String requestUrl = getBaseUrl(id) + "/value?thread=" + threadId + "&frame=" + frameIndex;
return asyncRequestFactory.createPutRequest(requestUrl, variableDto).send();
}

Expand All @@ -183,9 +194,9 @@ public Promise<Void> stepOut(String id, StepOutActionDto action) {
}

@Override
public Promise<String> evaluate(String id, String expression) {
String requestUrl = getBaseUrl(id) + "/evaluation";
String params = "?expression=" + URL.encodeQueryString(expression);
public Promise<String> evaluate(String id, String expression, long threadId, int frameIndex) {
String requestUrl = getBaseUrl(id) + "/evaluation?thread=" + threadId + "&frame=" + frameIndex;
String params = "&expression=" + URL.encodeQueryString(expression);
return asyncRequestFactory
.createGetRequest(requestUrl + params)
.loader(loaderFactory.newLoader())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Logger;

import org.eclipse.che.api.debug.shared.model.Location;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto;
import org.eclipse.che.commons.annotation.Nullable;
Expand Down Expand Up @@ -298,7 +300,6 @@ private BreakpointRenderer getBreakpointRendererForEditor(final EditorPartPresen
return null;
}

/** {@inheritDoc} */
@Override
public void onLineChange(
final VirtualFile file, final int firstLine, final int linesAdded, final int linesRemoved) {
Expand Down Expand Up @@ -611,8 +612,8 @@ public void onPreResume() {
}

@Override
public void onBreakpointStopped(String filePath, String className, int lineNumber) {
setCurrentBreakpoint(filePath, lineNumber - 1);
public void onBreakpointStopped(String filePath, Location location) {
setCurrentBreakpoint(filePath, location.getLineNumber() - 1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
*/
package org.eclipse.che.ide.debug;

import java.util.List;
import java.util.Map;
import org.eclipse.che.api.debug.shared.dto.ThreadDumpDto;
import org.eclipse.che.api.debug.shared.model.SimpleValue;
import org.eclipse.che.api.debug.shared.model.StackFrameDump;
import org.eclipse.che.api.debug.shared.model.Variable;
Expand Down Expand Up @@ -75,21 +77,42 @@ public interface Debugger extends DebuggerObservable {
/** Suspends application. */
void suspend();

/** Evaluates the given expression */
Promise<String> evaluate(String expression);
/**
* Evaluates the given expression inside specific frame.
*
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<String> evaluate(String expression, long threadId, int frameIndex);

/**
* Gets the value of the given variableinside specific frame.
*
* @param variable the variable to get value from
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
Promise<SimpleValue> getValue(Variable variable, long threadId, int frameIndex);

/** Gets the value of the given variable. */
Promise<SimpleValue> getValue(Variable variable);
/**
* Gets stack framedump.
*
* @param threadId the unique thread id
* @param frameIndex the frameindex in the thread
*/
Promise<StackFrameDump> getStackFrameDump(long threadId, int frameIndex);

/** Gets dump the current frame. */
Promise<StackFrameDump> dumpStackFrame();
/** Gets thread dump. */
Promise<List<ThreadDumpDto>> getThreadDump();

/**
* Updates the value of the given variable.
*
* @param variable the variable to update
* @param threadId the unique thread id
* @param frameIndex the frame index in the thread
*/
void setValue(Variable variable);
void setValue(Variable variable, long threadId, int frameIndex);

/** Indicates if connection is established with the server. */
boolean isConnected();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.eclipse.che.ide.debug;

import java.util.List;
import org.eclipse.che.api.debug.shared.model.Location;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.ide.api.debug.Breakpoint;

Expand Down Expand Up @@ -48,7 +49,7 @@ public interface DebuggerObserver {
void onPreResume();

/** Event happens when debugger stopped at breakpoint. */
void onBreakpointStopped(String filePath, String className, int lineNumber);
void onBreakpointStopped(String filePath, Location location);

/** Event happens when value changed. */
void onValueChanged(List<String> path, String newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,7 @@ public interface DebuggerLocalizationConstant extends com.google.gwt.i18n.client

@Key("view.editConfigurations.saveChanges.discard")
String editConfigurationsSaveChangesDiscard();

@Key("debugger.frames.title")
String debuggerFramesTitle();
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void actionPerformed(ActionEvent e) {
debuggerPresenter.showDebuggerPanel();
}
} else {
debuggerPresenter.showAndUpdateView();
debuggerPresenter.updateView();
debuggerPresenter.showDebuggerPanel();
}
}
Expand Down
Loading