Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e52d41f
add logs for attaching errors.
andxu Nov 14, 2017
07262b9
fix the user error log entry:
andxu Nov 14, 2017
2424752
In attach scenario, the remote JVM may be already terminated before C…
andxu Nov 14, 2017
80c2360
Avoid to pop up error message to users for vm terminated exception wh…
andxu Nov 14, 2017
6dfe372
Merge branch 'master' into andy_log_attach
andxu Nov 15, 2017
08cada7
Merge branch 'master' into andy_log_attach
andxu Nov 17, 2017
8ffb8ed
revert changes to handlers.
andxu Nov 17, 2017
a8755b8
Remove error notifications to vscode when VMDisconnectedException is …
andxu Nov 17, 2017
380e745
Merge branch 'master' into andy_log_attach
andxu Nov 17, 2017
4ae9498
fix typo
andxu Nov 21, 2017
72eb76a
Merge remote-tracking branch 'origin' into andy_log_attach
andxu Nov 22, 2017
a566665
Merge remote-tracking branch 'origin/andy_log_attach' into andy_log_a…
andxu Nov 22, 2017
837cd35
Merge remote-tracking branch 'origin' into andy_log_attach
andxu Nov 22, 2017
c2ff2f9
merge with async response change for handling VMDisconnectedException
andxu Nov 22, 2017
7079ece
set valid success to VMDisconnectedException
andxu Nov 22, 2017
546bc98
Update ProtocolServer.java
andxu Nov 22, 2017
ddc0d33
Merge branch 'master' into andy_log_attach
andxu Nov 22, 2017
45f558a
Merge branch 'master' into andy_log_attach
testforstephen Nov 24, 2017
5aedf4c
replace complex logic on whenComplete
andxu Nov 30, 2017
7b695ec
Merge remote-tracking branch 'origin' into andy_log_attach
andxu Nov 30, 2017
c667375
Merge remote-tracking branch 'origin' into andy_log_attach
andxu Nov 30, 2017
4b1fb4f
Merge branch 'master' into andy_log_attach
andxu Dec 5, 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 @@ -66,7 +66,11 @@ public List<Disposable> subscriptions() {
// AutoCloseable
@Override
public void close() throws Exception {
vm.eventRequestManager().deleteEventRequests(requests());
try {
vm.eventRequestManager().deleteEventRequests(requests());
} catch (VMDisconnectedException ex) {
// ignore since removing breakpoints is meaningless when JVM is terminated.
}
subscriptions().forEach(subscription -> {
subscription.dispose();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ProtocolServer extends AbstractProtocolServer {
*/
public ProtocolServer(InputStream input, OutputStream output, IProviderContext context) {
super(input, output);
this.debugAdapter = new DebugAdapter(this, context);
debugAdapter = new DebugAdapter(this, context);
}

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ public CompletableFuture<Messages.Response> sendRequest(Messages.Request request
@Override
protected void dispatchRequest(Messages.Request request) {
usageDataSession.recordRequest(request);
this.debugAdapter.dispatchRequest(request).thenCompose((response) -> {
debugAdapter.dispatchRequest(request).thenCompose((response) -> {
CompletableFuture<Void> future = new CompletableFuture<>();
if (response != null) {
sendResponse(response);
Expand Down Expand Up @@ -110,5 +110,4 @@ protected void dispatchRequest(Messages.Request request) {
return null;
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private CompletableFuture<Response> threads(Requests.ThreadsArguments arguments,
Types.Thread clientThread = new Types.Thread(thread.uniqueID(), "Thread [" + thread.name() + "]");
threads.add(clientThread);
}
} catch (VMDisconnectedException | ObjectCollectedException ex) {
} catch (ObjectCollectedException ex) {
// allThreads may throw VMDisconnectedException when VM terminates and thread.name() may throw ObjectCollectedException
// when the thread is exiting.
}
Expand Down Expand Up @@ -117,12 +117,8 @@ private CompletableFuture<Response> next(Requests.NextArguments arguments, Respo
private CompletableFuture<Response> pause(Requests.PauseArguments arguments, Response response, IDebugAdapterContext context) {
ThreadReference thread = DebugUtility.getThread(context.getDebugSession(), arguments.threadId);
if (thread != null) {
try {
thread.suspend();
context.getProtocolServer().sendEvent(new Events.StoppedEvent("pause", arguments.threadId));
} catch (VMDisconnectedException ex) {
return AdapterUtils.createAsyncErrorResponse(response, ErrorCode.VM_TERMINATED, "Target VM is already terminated.");
}
thread.suspend();
context.getProtocolServer().sendEvent(new Events.StoppedEvent("pause", arguments.threadId));
} else {
context.getDebugSession().suspend();
context.getProtocolServer().sendEvent(new Events.StoppedEvent("pause", arguments.threadId, true));
Expand Down