diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py index 3bd9870d9e7a..cd6a034e5aba 100644 --- a/python/helpers/pydev/pydevd.py +++ b/python/helpers/pydev/pydevd.py @@ -828,21 +828,16 @@ class PyDB: else: #Note: this else should be removed after PyCharm migrates to setting #breakpoints by id (and ideally also provides func_name). - type, file, line, condition, expression = text.split('\t', 4) + type, file, line, func_name, condition, expression = text.split('\t', 5) # If we don't have an id given for each breakpoint, consider # the id to be the line. breakpoint_id = line = int(line) - if condition.startswith('**FUNC**'): - func_name, condition = condition.split("@_@TAB_CHAR@_@", 1) - # We must restore new lines and tabs as done in - # AbstractDebugTarget.breakpointAdded - condition = condition.replace("@_@NEW_LINE_CHAR@_@", '\n').\ - replace("@_@TAB_CHAR@_@", '\t').strip() + condition = condition.replace("@_@NEW_LINE_CHAR@_@", '\n'). \ + replace("@_@TAB_CHAR@_@", '\t').strip() - func_name = func_name[8:] - else: - func_name = 'None' # Match anything if not specified. + expression = expression.replace("@_@NEW_LINE_CHAR@_@", '\n'). \ + replace("@_@TAB_CHAR@_@", '\t').strip() if not IS_PY3K: # In Python 3, the frame object will have unicode for the file, whereas on python 2 it has a byte-array encoded with the filesystem encoding. file = file.encode(file_system_encoding) diff --git a/python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractCommand.java b/python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractCommand.java index 0a2e7842ff20..41b5cd4f09b5 100644 --- a/python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractCommand.java +++ b/python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractCommand.java @@ -51,7 +51,6 @@ public abstract class AbstractCommand { 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; diff --git a/python/pydevSrc/com/jetbrains/python/debugger/pydev/SetBreakpointCommand.java b/python/pydevSrc/com/jetbrains/python/debugger/pydev/SetBreakpointCommand.java index c40c90905996..90061d17ae19 100644 --- a/python/pydevSrc/com/jetbrains/python/debugger/pydev/SetBreakpointCommand.java +++ b/python/pydevSrc/com/jetbrains/python/debugger/pydev/SetBreakpointCommand.java @@ -45,27 +45,7 @@ public class SetBreakpointCommand extends LineBreakpointCommand { @Override protected void buildPayload(Payload payload) { super.buildPayload(payload); - 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); + payload.add(buildCondition(myFuncName)).add(buildCondition(myCondition)).add(buildCondition(myLogExpression)); } @NotNull