diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 2495bfca2bf27339ad1e5dd31fca389d97d9c2d2..5460c3503331c6c8437d5016f564802aff2b2a89 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2660,6 +2660,7 @@ void DebuggerPluginPrivate::runControlFinished(DebuggerEngine *engine)
         m_snapshotHandler->activateSnapshot(0);
     }
     action(OperateByInstruction)->setValue(QVariant(false));
+    m_logWindow->clearUndoRedoStacks();
 }
 
 void DebuggerPluginPrivate::remoteCommand(const QStringList &options,
diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp
index f54f1c5611d125f0188936e2aea6b5b8c4363c65..32e702bc41581cbe3fa34aefcb1d0f61d4b1d0ab 100644
--- a/src/plugins/debugger/logwindow.cpp
+++ b/src/plugins/debugger/logwindow.cpp
@@ -198,6 +198,13 @@ public:
         appendPlainText(text);
     }
 
+    void clearUndoRedoStacks()
+    {
+        if (!isUndoRedoEnabled())
+            return;
+        setUndoRedoEnabled(false);
+        setUndoRedoEnabled(true);
+    }
 
 private slots:
     void saveContents();
@@ -527,6 +534,12 @@ QString LogWindow::inputContents() const
     return m_inputText->toPlainText();
 }
 
+void LogWindow::clearUndoRedoStacks()
+{
+    m_inputText->clearUndoRedoStacks();
+    m_combinedText->clearUndoRedoStacks();
+}
+
 QString LogWindow::logTimeStamp()
 {
     // Cache the last log time entry by ms. If time progresses,
diff --git a/src/plugins/debugger/logwindow.h b/src/plugins/debugger/logwindow.h
index cabc729c8c328f00904fcfb90af87de3612b35aa..f01ac447199d17ce7e8f7f2f066418732e93a223 100644
--- a/src/plugins/debugger/logwindow.h
+++ b/src/plugins/debugger/logwindow.h
@@ -61,6 +61,8 @@ public:
     QString combinedContents() const;
     QString inputContents() const;
 
+    void clearUndoRedoStacks();
+
     static QString logTimeStamp();
 
     static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = 0);