From 7dc71bc43ca966ed395b3f7ab01d24d5bba0b83d Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Mon, 7 May 2012 15:04:06 +0200
Subject: [PATCH] debugger: display references in type columns

This breaks tradition.

Change-Id: I6780f31d584021490293a1ed3a96b5c3608a8a36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <qthjk@ovi.com>
---
 share/qtcreator/dumper/dumper.py                |  1 +
 src/plugins/debugger/watchdata.cpp              |  2 --
 .../manual/debugger/simple/simple_test_app.cpp  | 17 +++++++++--------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/share/qtcreator/dumper/dumper.py b/share/qtcreator/dumper/dumper.py
index c5cc107fa4b..cb9afa57f62 100644
--- a/share/qtcreator/dumper/dumper.py
+++ b/share/qtcreator/dumper/dumper.py
@@ -1422,6 +1422,7 @@ class Dumper:
                 # generic pointer." with MinGW's gcc 4.5 when it "identifies"
                 # a "QWidget &" as "void &" and with optimized out code.
                 self.putItem(value.cast(type.target().unqualified()))
+                self.putBetterType(typeName)
                 return
             except RuntimeError:
                 self.putValue("<optimized out reference>")
diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp
index 580afb3c06e..be6efdcaad0 100644
--- a/src/plugins/debugger/watchdata.cpp
+++ b/src/plugins/debugger/watchdata.cpp
@@ -260,8 +260,6 @@ void WatchData::setType(const QByteArray &str, bool guessChildrenFromType)
             type.chop(5);
         else if (type.endsWith(' '))
             type.chop(1);
-        else if (type.endsWith('&'))
-            type.chop(1);
         else if (type.startsWith("const "))
             type = type.mid(6);
         else if (type.startsWith("volatile "))
diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp
index 2d633f469c7..8259c349cc7 100644
--- a/tests/manual/debugger/simple/simple_test_app.cpp
+++ b/tests/manual/debugger/simple/simple_test_app.cpp
@@ -2118,7 +2118,8 @@ namespace final {
         // CheckType p int.
         // Check p 21 int.
         // Check q 0x0 int *.
-        // Check qq <null reference> int.
+        // Check pp 21 int &.
+        // Check qq <null reference> int &.
         // Continue.
         return; // Uncomment.
         testNullReferenceHelper(pp, qq);
@@ -4751,7 +4752,7 @@ namespace basic {
         const Ref d = a;
         BREAK_HERE;
         // Check a 43 int.
-        // Check b 43 int.
+        // Check b 43 int &.
         // Check c 44 int.
         // Check d 43 basic::Ref.
         // Continue.
@@ -4767,7 +4768,7 @@ namespace basic {
         const Ref d = a;
         BREAK_HERE;
         // Check a "hello" QString.
-        // Check b "bababa" QString.
+        // Check b "bababa" QString &.
         // Check c "world" QString.
         // Check d "hello" basic::Ref.
         // Continue.
@@ -4780,8 +4781,8 @@ namespace basic {
         typedef QString &Ref;
         const Ref d = const_cast<Ref>(a);
         BREAK_HERE;
-        // Check a "hello" QString.
-        // Check b "hello" QString.
+        // Check a "hello" QString &.
+        // Check b "hello" QString &.
         // Check d "hello" basic::Ref.
         // Continue.
         dummyStatement(&a, &b, &d);
@@ -4859,13 +4860,13 @@ namespace basic {
     {
         BREAK_HERE;
         // Expand f.
-        // CheckType f Foo.
+        // CheckType f Foo &.
         // Check f.a 12 int.
         // Continue.
         ++f.a;
         BREAK_HERE;
         // Expand f.
-        // CheckType f Foo.
+        // CheckType f Foo &.
         // Check f.a 13 int.
         // Continue.
     }
@@ -5720,7 +5721,7 @@ namespace bug5184 {
         BREAK_HERE;
         // Check raw <0 items> QList<QByteArray>.
         // CheckType request QNetworkRequest.
-        // Check url "http://127.0.0.1/" QUrl.
+        // Check url "http://127.0.0.1/" QUrl &.
         // Continue.
         dummyStatement(&request, &raw);
     }
-- 
GitLab