Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2f2b2de
make loggers non-static
mzarnowski Jul 19, 2019
4c35a1f
propagate loggers from ProtocolServer
mzarnowski Jul 19, 2019
3536779
create explicit type for logger factory
mzarnowski Jul 22, 2019
0df2ed6
revert to ignoring case when comparing fields' names
Jul 31, 2019
244576a
Merge pull request #1 from marek1840/make-logging-customizable
jvican Jul 31, 2019
651e414
Merge branch 'main' of github.com:microsoft/java-debug into microsoft…
adpi2 Jun 11, 2021
0c44812
Fix logger customization
adpi2 Jun 14, 2021
640ae67
Merge branch 'microsoft-main' into main
adpi2 Jun 14, 2021
4a6c57d
Fix unused imports
adpi2 Jun 14, 2021
e3c40ce
Deploy custom java-debug-core
adpi2 Jun 15, 2021
bf9a6e4
Merge pull request #3 from adpi2/deploy-snapshot
adpi2 Jun 15, 2021
cb56e1b
Bump version to 0.33.0 (#386)
testforstephen Sep 23, 2021
9d88e12
Revert "Bump version to 0.33.0 (#386)"
adpi2 Feb 25, 2022
38a87db
Merge tag '0.34.0' into main
adpi2 Feb 25, 2022
be7fad7
Add IStepFilterProvider
adpi2 Jul 7, 2022
e6560ba
fix style
adpi2 Jul 7, 2022
55b5e69
Fix pom files
adpi2 Jul 8, 2022
8b510c5
Run CI on branch 0.34.0+x
adpi2 Jul 8, 2022
60c4a76
Up version to 0.34.0+2
adpi2 Jul 8, 2022
c41a93e
Merge pull request #7 from adpi2/0.34.0+2
adpi2 Jul 8, 2022
f56bf57
Add filtering for step out
adpi2 Jul 15, 2022
814a43b
fix version of eclipse snapshot
adpi2 Jul 15, 2022
2c17e86
Merge pull request #8 from scalacenter/filter-step-out
adpi2 Jul 18, 2022
06e34c6
Prepare release 0.34.0+3
adpi2 Jul 18, 2022
b880873
fix stepping out filter
adpi2 Jul 18, 2022
b39d1c0
Prepare release 0.34.0+4
adpi2 Jul 18, 2022
6b3160c
Add shouldStepOut in StepFilterProvider
adpi2 Oct 2, 2022
718d782
Release 0.34.0+5
adpi2 Oct 2, 2022
4d19fec
Reorder step filter logic
adpi2 Oct 3, 2022
be72edb
Fix restart frame handler
adpi2 Oct 4, 2022
a67da2e
Bump version to 0.34.0+7-SNAPSHOT
adpi2 Oct 4, 2022
7d92828
Fix step handler when upperFrame is null
adpi2 Oct 4, 2022
36a426d
Release 0.34.0+7
adpi2 Oct 5, 2022
9e23f5b
Always disable pending step request before stopping thread
adpi2 Oct 18, 2022
d289974
Skip breakpoint if shouldSkipOver
adpi2 Oct 18, 2022
11bf651
Release 0.34.0+8
adpi2 Oct 19, 2022
acd27e0
Deactivate evaluate for hovers
adpi2 Oct 20, 2022
d91006d
Release 0.34.0+9
adpi2 Oct 20, 2022
c4af552
Fix Java doc generation
adpi2 Oct 28, 2022
bdf8433
update .project
adpi2 Nov 3, 2022
798d5f7
Add format in IStepFilterProvider
aymanelamyaghri Mar 30, 2023
5c4ff53
rename formatMethodSig
aymanelamyaghri May 11, 2023
bf0ce15
Fix Java 8 compat
aymanelamyaghri May 11, 2023
14854c6
Rename IStepFilterProvider to IStackTraceProvider
adpi2 Jun 16, 2023
23df7eb
Open VariableUtils API (#9)
iusildra Jun 20, 2023
a4018d0
all providers getter
iusildra Aug 9, 2023
57e71e9
getProviders returns a list
adpi2 Aug 15, 2023
d5608e5
catch all throwables from dispatch request
adpi2 Dec 21, 2023
39b44d1
Reinstall all breakpoints in files that changed
adpi2 Feb 9, 2024
901d541
Introduce DecodedMethod
adpi2 Feb 22, 2024
f94ff12
Quick and dirty fix of scala-debug-adapter#664
adpi2 Feb 22, 2024
b87d910
Revert "Quick and dirty fix of scala-debug-adapter#664"
adpi2 Mar 6, 2024
d53200a
Use subtle presentation hint for generated methods
adpi2 Mar 11, 2024
2f1fd9b
decode variable
SaadAissa Jul 9, 2024
a49309b
decode variables and fields basics
SaadAissa Jul 16, 2024
f6b68c7
exceptions when notFound
SaadAissa Jul 23, 2024
9a8cf3b
don't show static fields
SaadAissa Jul 24, 2024
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
Prev Previous commit
Next Next commit
Revert "Bump version to 0.33.0 (#386)"
This reverts commit cb56e1b.
  • Loading branch information
adpi2 committed Feb 25, 2022
commit 9d88e12e3997d2e5782bce3c5de98533861c770f
437 changes: 0 additions & 437 deletions ThirdPartyNotices.txt

This file was deleted.

2 changes: 1 addition & 1 deletion com.microsoft.java.debug.core/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
9 changes: 4 additions & 5 deletions com.microsoft.java.debug.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.epfl.scala</groupId>
<artifactId>com-microsoft-java-debug-core</artifactId>
<packaging>jar</packaging>
<name>${base.name} :: Debugger Core</name>
<description>The Java Debug Server is an implementation of Visual Studio Code (VSCode) Debug Protocol. It can be used in Visual Studio Code to debug Java programs.</description>
<url>https://github.com/Microsoft/java-debug</url>
Expand Down Expand Up @@ -80,8 +79,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>11</source>
<target>11</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -127,7 +126,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
Expand All @@ -142,7 +141,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.10.0</version>
<version>2.5</version>
</dependency>
<!-- Dependencies for test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void stop() {
}

private void monitor(InputStream input, PublishSubject<String> subject) {
BufferedReader reader = new BufferedReader(encoding == null ? new InputStreamReader(input) : new InputStreamReader(input, encoding));
BufferedReader reader = new BufferedReader(new InputStreamReader(input, encoding));
final int BUFFERSIZE = 4096;
char[] buffer = new char[BUFFERSIZE];
while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

package com.microsoft.java.debug.core.adapter.handler;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -46,7 +46,7 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
// completions should be illegal when frameId is zero, it is sent when the program is running, while during running we cannot resolve
// the completion candidates
if (completionsArgs.frameId == 0) {
response.body = new Responses.CompletionsResponseBody(Collections.emptyList());
response.body = new ArrayList<>();
return CompletableFuture.completedFuture(response);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017-2021 Microsoft Corporation and others.
* Copyright (c) 2017-2020 Microsoft Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -14,6 +14,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -105,58 +106,31 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
indexedVariables = ((IntegerValue) sizeValue).value();
}
}
} catch (Exception e) {
logger.log(Level.INFO, "Failed to get the logical size of the variable", e);
} catch (CancellationException | IllegalArgumentException | InterruptedException
| ExecutionException | UnsupportedOperationException e) {
logger.log(Level.INFO,
String.format("Failed to get the logical size for the type %s.", value.type().name()), e);
}
}
int referenceId = 0;
if (indexedVariables > 0 || (indexedVariables < 0 && value instanceof ObjectReference)) {
referenceId = context.getRecyclableIdPool().addObject(threadId, varProxy);
}

boolean hasErrors = false;
String valueString = null;
try {
valueString = variableFormatter.valueToString(value, options);
} catch (OutOfMemoryError e) {
hasErrors = true;
logger.log(Level.SEVERE, "Failed to convert the value of a large object to a string", e);
valueString = "<Unable to display the value of a large object>";
} catch (Exception e) {
hasErrors = true;
logger.log(Level.SEVERE, "Failed to resolve the variable value", e);
valueString = "<Failed to resolve the variable value due to \"" + e.getMessage() + "\">";
}

String valueString = variableFormatter.valueToString(value, options);
String detailsString = null;
if (hasErrors) {
// If failed to resolve the variable value, skip the details info as well.
} else if (sizeValue != null) {
if (sizeValue != null) {
detailsString = "size=" + variableFormatter.valueToString(sizeValue, options);
} else if (DebugSettings.getCurrent().showToString) {
try {
detailsString = VariableDetailUtils.formatDetailsValue(value, stackFrameReference.getThread(), variableFormatter, options, engine);
} catch (OutOfMemoryError e) {
logger.log(Level.SEVERE, "Failed to compute the toString() value of a large object", e);
detailsString = "<Unable to display the details of a large object>";
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to compute the toString() value", e);
detailsString = "<Failed to resolve the variable details due to \"" + e.getMessage() + "\">";
}
detailsString = VariableDetailUtils.formatDetailsValue(value, stackFrameReference.getThread(), variableFormatter, options, engine);
}

if ("clipboard".equals(evalArguments.context) && detailsString != null) {
response.body = new Responses.EvaluateResponseBody(detailsString, -1, "String", 0);
} else {
String typeString = "";
try {
typeString = variableFormatter.typeToString(value == null ? null : value.type(), options);
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to resolve the variable type", e);
typeString = "";
}
response.body = new Responses.EvaluateResponseBody((detailsString == null) ? valueString : valueString + " " + detailsString,
referenceId, typeString, Math.max(indexedVariables, 0));
referenceId, variableFormatter.typeToString(value == null ? null : value.type(), options),
Math.max(indexedVariables, 0));
}
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand Down Expand Up @@ -90,21 +91,23 @@ protected CompletableFuture<Response> handleLaunchCommand(Arguments arguments, R
"Failed to launch debuggee VM. Missing mainClass or modulePaths/classPaths options in launch configuration.",
ErrorCode.ARGUMENT_MISSING);
}
if (StringUtils.isNotBlank(launchArguments.encoding)) {
if (StringUtils.isBlank(launchArguments.encoding)) {
context.setDebuggeeEncoding(StandardCharsets.UTF_8);
} else {
if (!Charset.isSupported(launchArguments.encoding)) {
throw AdapterUtils.createCompletionException(
"Failed to launch debuggee VM. 'encoding' options in the launch configuration is not recognized.",
ErrorCode.INVALID_ENCODING);
}
context.setDebuggeeEncoding(Charset.forName(launchArguments.encoding));
if (StringUtils.isBlank(launchArguments.vmArgs)) {
launchArguments.vmArgs = String.format("-Dfile.encoding=%s", context.getDebuggeeEncoding().name());
} else {
// if vmArgs already has the file.encoding settings, duplicate options for jvm will not cause an error, the right most value wins
launchArguments.vmArgs = String.format("%s -Dfile.encoding=%s", launchArguments.vmArgs, context.getDebuggeeEncoding().name());
}
}

if (StringUtils.isBlank(launchArguments.vmArgs)) {
launchArguments.vmArgs = String.format("-Dfile.encoding=%s", context.getDebuggeeEncoding().name());
} else {
// if vmArgs already has the file.encoding settings, duplicate options for jvm will not cause an error, the right most value wins
launchArguments.vmArgs = String.format("%s -Dfile.encoding=%s", launchArguments.vmArgs, context.getDebuggeeEncoding().name());
}
context.setLaunchMode(launchArguments.noDebug ? LaunchMode.NO_DEBUG : LaunchMode.DEBUG);

activeLaunchHandler.preLaunch(launchArguments, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public static synchronized Path generateClasspathJar(String[] classPaths) throws
public static synchronized Path generateArgfile(String[] classPaths, String[] modulePaths) throws IOException {
String argfile = "";
if (ArrayUtils.isNotEmpty(classPaths)) {
argfile = "-cp \"" + String.join(File.pathSeparator, classPaths) + "\"";
argfile = "-classpath \"" + String.join(File.pathSeparator, classPaths) + "\"";
}

if (ArrayUtils.isNotEmpty(modulePaths)) {
argfile += " --module-path \"" + String.join(File.pathSeparator, modulePaths) + "\"";
argfile = " --module-path \"" + String.join(File.pathSeparator, modulePaths) + "\"";
}

argfile = argfile.replace("\\", "\\\\");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,20 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession, IDebugAdapterContext context,
ThreadState threadState) {
Event event = debugEvent.event;
EventRequestManager eventRequestManager = debugSession.getVM().eventRequestManager();

// When a breakpoint occurs, abort any pending step requests from the same thread.
if (event instanceof BreakpointEvent || event instanceof ExceptionEvent) {
long threadId = ((LocatableEvent) event).thread().uniqueID();
if (threadId == threadState.threadId && threadState.pendingStepRequest != null) {
threadState.deleteStepRequest(eventRequestManager);
threadState.deleteMethodExitRequest(eventRequestManager);
threadState.deleteStepRequests(debugSession.getVM().eventRequestManager());
context.getStepResultManager().removeMethodResult(threadId);
if (threadState.eventSubscription != null) {
threadState.eventSubscription.dispose();
}
}
} else if (event instanceof StepEvent) {
ThreadReference thread = ((StepEvent) event).thread();
threadState.deleteStepRequest(eventRequestManager);
threadState.deleteStepRequests(debugSession.getVM().eventRequestManager());
if (isStepFiltersConfigured(context.getStepFilters())) {
try {
if (threadState.pendingStepType == Command.STEPIN) {
Expand All @@ -183,7 +181,6 @@ private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession,
// ignore.
}
}
threadState.deleteMethodExitRequest(eventRequestManager);
if (threadState.eventSubscription != null) {
threadState.eventSubscription.dispose();
}
Expand Down Expand Up @@ -283,13 +280,10 @@ class ThreadState {
Location stepLocation = null;
Disposable eventSubscription = null;

public void deleteMethodExitRequest(EventRequestManager manager) {
public void deleteStepRequests(EventRequestManager manager) {
DebugUtility.deleteEventRequestSafely(manager, this.pendingStepRequest);
DebugUtility.deleteEventRequestSafely(manager, this.pendingMethodExitRequest);
this.pendingMethodExitRequest = null;
}

public void deleteStepRequest(EventRequestManager manager) {
DebugUtility.deleteEventRequestSafely(manager, this.pendingStepRequest);
this.pendingStepRequest = null;
}
}
Expand Down
Loading