diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java index c2436abb0b50..4608ef6d8419 100644 --- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java +++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java @@ -767,8 +767,8 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr final Project project = getSession().getProject(); if (document != null) { if (file.getFileType() == PythonFileType.INSTANCE) { - PsiElement psiElement = XDebuggerUtil.getInstance().findContextElement(file, breakpoint.getSourcePosition().getOffset(), - project, false); + PsiElement psiElement = XDebuggerUtil.getInstance(). + findContextElement(file, document.getLineStartOffset(breakpoint.getSourcePosition().getLine()), project, false); PyFunction function = PsiTreeUtil.getParentOfType(psiElement, PyFunction.class); if (function != null) { return function.getName();