diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index c769e4b1c11bab79e9b3d05b05b5585e1c15a0f3..6ca4586dea4d4eecf7b14064abc294df0a0255f0 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1092,10 +1092,16 @@ void DebuggerPlugin::gotoLocation(const StackFrame &frame, bool setMarker)
         if (setMarker)
             resetLocation();
     } else {
-        TextEditor::BaseTextEditor::openEditorAt(frame.file, frame.line);
-        if (setMarker) {
-            resetLocation();
-            m_locationMark = new LocationMark(frame.file, frame.line);
+        static QString lastFile;
+        static int lastLine;
+        if (frame.line != lastLine || frame.file != lastFile) {
+            lastLine = frame.line;
+            lastFile = frame.file;
+            TextEditor::BaseTextEditor::openEditorAt(frame.file, frame.line);
+            if (setMarker) {
+                resetLocation();
+                m_locationMark = new LocationMark(frame.file, frame.line);
+            }
         }
     }
 }