mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
merge pydev_debugger
This commit is contained in:
@@ -833,7 +833,7 @@ class PyDB:
|
||||
# the id to be the line.
|
||||
breakpoint_id = line = int(line)
|
||||
if condition.startswith('**FUNC**'):
|
||||
func_name, condition = condition.split('\t', 1)
|
||||
func_name, condition = condition.split("@_@TAB_CHAR@_@", 1)
|
||||
|
||||
# We must restore new lines and tabs as done in
|
||||
# AbstractDebugTarget.breakpointAdded
|
||||
|
||||
@@ -51,6 +51,7 @@ public abstract class AbstractCommand<T> {
|
||||
public static final int VERSION = 501;
|
||||
public static final String NEW_LINE_CHAR = "@_@NEW_LINE_CHAR@_@";
|
||||
public static final String TAB_CHAR = "@_@TAB_CHAR@_@";
|
||||
public static final String FUNC_IN_CONDITION = "**FUNC**";
|
||||
|
||||
|
||||
@NotNull private final RemoteDebugger myDebugger;
|
||||
|
||||
@@ -7,14 +7,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class SetBreakpointCommand extends LineBreakpointCommand {
|
||||
private @Nullable final String myCondition;
|
||||
private @Nullable final String myLogExpression;
|
||||
private @Nullable final String myFuncName;
|
||||
|
||||
public SetBreakpointCommand(@NotNull final RemoteDebugger debugger,
|
||||
@NotNull final String type,
|
||||
@NotNull final String file,
|
||||
@NotNull final int line) {
|
||||
this(debugger, type, file, line, null, null);
|
||||
this(debugger, type, file, line, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
public SetBreakpointCommand(@NotNull final RemoteDebugger debugger,
|
||||
@NotNull final String type,
|
||||
@NotNull final String file,
|
||||
@@ -24,12 +26,46 @@ public class SetBreakpointCommand extends LineBreakpointCommand {
|
||||
super(debugger, type, SET_BREAKPOINT, file, line);
|
||||
myCondition = condition;
|
||||
myLogExpression = logExpression;
|
||||
myFuncName = null;
|
||||
}
|
||||
|
||||
public SetBreakpointCommand(@NotNull final RemoteDebugger debugger,
|
||||
@NotNull final String type,
|
||||
@NotNull final String file,
|
||||
@NotNull final int line,
|
||||
@Nullable final String condition,
|
||||
@Nullable final String logExpression,
|
||||
@Nullable final String funcName) {
|
||||
super(debugger, type, SET_BREAKPOINT, file, line);
|
||||
myCondition = condition;
|
||||
myLogExpression = logExpression;
|
||||
myFuncName = funcName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPayload(Payload payload) {
|
||||
super.buildPayload(payload);
|
||||
payload.add(buildCondition(myCondition)).add(buildCondition(myLogExpression));
|
||||
payload.add(buildConditionWithFunc(myCondition, myFuncName)).add(buildCondition(myLogExpression));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String buildConditionWithFunc(String expression, String functionName) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (functionName != null) {
|
||||
builder.append(FUNC_IN_CONDITION);
|
||||
builder.append(functionName);
|
||||
builder.append(TAB_CHAR);
|
||||
}
|
||||
|
||||
if (expression != null) {
|
||||
builder.append(expression.replaceAll("\n", NEW_LINE_CHAR));
|
||||
} else {
|
||||
builder.append("None");
|
||||
}
|
||||
String condition = builder.toString();
|
||||
|
||||
return condition.replaceAll("\t", TAB_CHAR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user