From b076618aa96fa47c0708e93545e9215dc7c504d0 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 17 Dec 2013 18:36:06 -0800
Subject: [PATCH] Add support for __m128i types in the debugging dumpers

I can't make it display the unsigned char[16] as a string and I have
no clue why. This is all magic to me...

This is good enough anyway

Change-Id: I1d78c01b3baaec8e7d4506552d79a536b573e9a6
Reviewed-by: hjk <hjk121@nokiamail.com>
---
 share/qtcreator/debugger/misctypes.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py
index 11515d9dd8..ef416c61a5 100644
--- a/share/qtcreator/debugger/misctypes.py
+++ b/share/qtcreator/debugger/misctypes.py
@@ -48,6 +48,30 @@ def qdump____m128(d, value):
         else: # Default, As float
             d.putArrayData(d.lookupType("float"), value.address, 4)
 
+def qdump____m128i(d, value):
+    data = d.readMemory(value.address, 16)
+    d.putValue(':'.join("%04x" % int(data[i:i+4], 16) for i in xrange(0, 32, 4)))
+    d.putNumChild(4)
+    if d.isExpanded():
+        # fake 4 children as arrays
+        with Children(d):
+            with SubItem(d, "uint8x16"):
+                d.putEmptyValue()
+                d.putType("unsigned char [16]")
+                d.putArrayData(d.lookupType("unsigned char"), value.address, 16)
+                d.putAddress(value.address)
+            with SubItem(d, "uint16x8"):
+                d.putEmptyValue()
+                d.putType("unsigned short [8]")
+                d.putArrayData(d.lookupType("unsigned short"), value.address, 8)
+            with SubItem(d, "uint32x4"):
+                d.putEmptyValue()
+                d.putType("unsigned int [4]")
+                d.putArrayData(d.lookupType("unsigned int"), value.address, 4)
+            with SubItem(d, "uint64x2"):
+                d.putEmptyValue()
+                d.putType("unsigned long long [2]")
+                d.putArrayData(d.lookupType("unsigned long long"), value.address, 2)
 
 #######################################################################
 #
-- 
GitLab