diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index b8bc4dad5a1d9f5f6ea875f788fdd7beb5031bc3..6d90a3f7bedeb55f527b78f30456d4d32a65b33e 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -149,6 +149,9 @@ DebuggerSettings *theDebuggerSettings()
     item = new SavedAction(instance);
     instance->insertItem(AssignValue, item);
 
+    item = new SavedAction(instance);
+    instance->insertItem(AssignType, item);
+
     item = new SavedAction(instance);
     instance->insertItem(ExpandItem, item);
     item->setText(QObject::tr("Expand item"));
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index 079a879bc79f2a239780560b4e4a4e0e8839e8c3..95167153e181dba6a4701061e17a0bf724823401 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -86,6 +86,7 @@ enum DebuggerActionCode
     WatchModelUpdate,
     UseToolTips,
     AssignValue,
+    AssignType,
     ExpandItem,
     CollapseItem,
 
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index af120e3a18ca8c47bc9e5379ce1715f34f25f5b7..b2af8278d94ba1a6818ea2d3d1d007695d500fd7 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -520,9 +520,11 @@ Qt::ItemFlags WatchHandler::flags(const QModelIndex &idx) const
     const WatchData &data = m_displaySet.at(node);
 
     if (data.isWatcher() && idx.column() == 0)
-        return editable; // watcher names are
-    if (idx.column() == 1) 
-        return editable; // values are editable
+        return editable; // watcher names are editable
+    if (data.isWatcher() && idx.column() == 2)
+        return editable; // watcher types are
+    if (idx.column() == 1)
+        return editable; // locals and watcher values are editable
     return  notEditable;
 }
 
diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp
index e10d39319b68f80f7b2619ea542e19d8df444f99..77f09f792080420df0283325c47a25ce5a6282f4 100644
--- a/src/plugins/debugger/watchwindow.cpp
+++ b/src/plugins/debugger/watchwindow.cpp
@@ -87,6 +87,9 @@ public:
         if (index.column() == 1) {
             // the value column
             theDebuggerAction(AssignValue)->trigger(exp + '=' + value);
+        } else if (index.column() == 2) {
+            // the type column
+            theDebuggerAction(AssignType)->trigger(exp + '=' + value);
         } else if (index.column() == 0) {
             // the watcher name column
             theDebuggerAction(RemoveWatchExpression)->trigger(exp);
@@ -139,11 +142,16 @@ void WatchWindow::collapseNode(const QModelIndex &idx)
 
 void WatchWindow::keyPressEvent(QKeyEvent *ev)
 {
-    if (ev->key() == Qt::Key_Delete) {
+    if (ev->key() == Qt::Key_Delete && m_type == WatchersType) {
         QModelIndex idx = currentIndex();
         QModelIndex idx1 = idx.sibling(idx.row(), 0);
         QString exp = model()->data(idx1).toString();
-        theDebuggerAction(RemoveWatchExpression)->setValue(exp);
+        theDebuggerAction(RemoveWatchExpression)->trigger(exp);
+    } else if (ev->key() == Qt::Key_Return && m_type == LocalsType) {
+        QModelIndex idx = currentIndex();
+        QModelIndex idx1 = idx.sibling(idx.row(), 0);
+        QString exp = model()->data(idx1).toString();
+        theDebuggerAction(WatchExpression)->trigger(exp);
     }
     QTreeView::keyPressEvent(ev);
 }
diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp
index 9ff77312df2dd29bb552d4dcb70812147c50d45e..8b51d7f8b767f506cd1470f587749433b3bd3ba9 100644
--- a/tests/manual/gdbdebugger/simple/app.cpp
+++ b/tests/manual/gdbdebugger/simple/app.cpp
@@ -116,6 +116,12 @@ private:
 
 void testArray()
 {
+    char c[20];
+    c[0] = 'a';
+    c[1] = 'b';
+    c[2] = 'c';
+    c[3] = 'd';
+
     QString x[20];
     x[0] = "a";
     x[1] = "b";
@@ -407,6 +413,10 @@ void testQObject(int &argc, char *argv[])
     QAction act("xxx", &app);
     QString t = act.text();
     t += "y";
+    t += "y";
+    t += "y";
+    t += "y";
+    t += "y";
 
 /*
     QObject ob(&app);
diff --git a/tests/manual/gdbdebugger/simple/app/app.pro b/tests/manual/gdbdebugger/simple/app/app.pro
index ab98e906f48684240b771c9c377075bd7355ec60..2210857b6a2cf2a7adaafea0b08f739034cac8df 100644
--- a/tests/manual/gdbdebugger/simple/app/app.pro
+++ b/tests/manual/gdbdebugger/simple/app/app.pro
@@ -8,4 +8,4 @@ DESTDIR = ..
 SOURCES += ../app.cpp
 QT += network
 
-mesage("this says <foo & bar>")
+message("this says <foo & bar>")