mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-257582 Auto attach debugger to waiting process
GitOrigin-RevId: 57bac88e733f8ffb58c5a6edc1b287e5dcd33ff5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
15287750dd
commit
71143718aa
+11
-1
@@ -11,6 +11,7 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorCustomElementRenderer;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -21,11 +22,16 @@ import java.util.regex.Pattern;
|
||||
public class JavaDebuggerConsoleFilterProvider implements ConsoleFilterProvider {
|
||||
@Override
|
||||
public Filter @NotNull [] getDefaultFilters(@NotNull Project project) {
|
||||
return new Filter[]{new JavaDebuggerAttachFilter()};
|
||||
return new Filter[]{new JavaDebuggerAttachFilter(project)};
|
||||
}
|
||||
|
||||
private static class JavaDebuggerAttachFilter implements Filter {
|
||||
static final Pattern PATTERN = Pattern.compile("Listening for transport (\\S+) at address: (\\S+)");
|
||||
private final Project myProject;
|
||||
|
||||
private JavaDebuggerAttachFilter(Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Result applyFilter(@NotNull String line, int entireLength) {
|
||||
@@ -38,6 +44,10 @@ public class JavaDebuggerConsoleFilterProvider implements ConsoleFilterProvider
|
||||
String address = matcher.group(2);
|
||||
int start = entireLength - line.length();
|
||||
|
||||
if (Registry.is("debugger.auto.attach.from.console")) {
|
||||
JavaAttachDebuggerProvider.attach(transport, address, null, myProject);
|
||||
}
|
||||
|
||||
// to trick the code unwrapping single results in com.intellij.execution.filters.CompositeFilter#createFinalResult
|
||||
return new Result(Arrays.asList(
|
||||
new AttachInlayResult(start + matcher.start(), start + matcher.end(), transport, address),
|
||||
|
||||
@@ -486,6 +486,8 @@ debugger.async.jdi=true
|
||||
debugger.async.jdi.description=Use async jdi to speedup jdwp communication
|
||||
debugger.merge.pause.and.resume=false
|
||||
debugger.merge.pause.and.resume.description=Merge "Pause" and "Resume" buttons on toolbar
|
||||
debugger.auto.attach.from.console=false
|
||||
debugger.auto.attach.from.console.description=Auto attach to all processes available for debug from the console output
|
||||
|
||||
execution.java.always.debug=false
|
||||
execution.java.always.debug.description=Always run java processes with the debug agent
|
||||
|
||||
Reference in New Issue
Block a user