Skip to content

Commit

Permalink
refine the debug trace (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
testforstephen authored Sep 1, 2022
1 parent a5bbebc commit 5bac075
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,

Map<String, Object> traceInfo = new HashMap<>();
traceInfo.put("localAttach", context.isLocalDebugging());
traceInfo.put("asyncJDWP", context.asyncJDWP());

IVirtualMachineManagerProvider vmProvider = context.getProvider(IVirtualMachineManagerProvider.class);
vmHandler.setVmProvider(vmProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public List<Command> getTargetCommands() {
public CompletableFuture<Response> handle(Command command, Arguments arguments, Response response, IDebugAdapterContext context) {
IDebugSession debugSession = context.getDebugSession();
vmHandler.setVmProvider(context.getProvider(IVirtualMachineManagerProvider.class));
UsageDataSession.recordInfo("asyncJDWP", context.asyncJDWP());
if (debugSession != null) {
// This is a global event handler to handle the JDI Event from Virtual Machine.
debugSession.getEventHub().events().subscribe(debugEvent -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.microsoft.java.debug.core.DebugUtility;
import com.microsoft.java.debug.core.IDebugSession;
import com.microsoft.java.debug.core.LaunchException;
import com.microsoft.java.debug.core.UsageDataSession;
import com.microsoft.java.debug.core.adapter.AdapterUtils;
import com.microsoft.java.debug.core.adapter.ErrorCode;
import com.microsoft.java.debug.core.adapter.IDebugAdapterContext;
Expand Down Expand Up @@ -76,6 +77,12 @@ public List<Command> getTargetCommands() {
@Override
public CompletableFuture<Response> handle(Command command, Arguments arguments, Response response, IDebugAdapterContext context) {
LaunchArguments launchArguments = (LaunchArguments) arguments;
Map<String, Object> traceInfo = new HashMap<>();
traceInfo.put("asyncJDWP", context.asyncJDWP());
traceInfo.put("noDebug", launchArguments.noDebug);
traceInfo.put("console", launchArguments.console);
UsageDataSession.recordInfo("launch debug info", traceInfo);

activeLaunchHandler = launchArguments.noDebug ? new LaunchWithoutDebuggingDelegate((daContext) -> handleTerminatedEvent(daContext))
: new LaunchWithDebuggingDelegate();
return handleLaunchCommand(arguments, response, context);
Expand Down

0 comments on commit 5bac075

Please sign in to comment.