From 26339061e331a5e9eaba9ef78bb556712313c2bf Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 26 Oct 2010 10:40:31 +0200 Subject: [PATCH] debugger: add python dumpers for __m128 --- share/qtcreator/gdbmacros/dumper.py | 6 ++- share/qtcreator/gdbmacros/gdbmacros.py | 27 ++++++++++ .../gdbdebugger/simple/simple_gdbtest_app.cpp | 51 ++++++++++++++++++- .../gdbdebugger/simple/simple_gdbtest_app.pro | 8 ++- 4 files changed, 84 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index f286a47d15e..34cc76c2047 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -1477,12 +1477,16 @@ class Dumper: if self.useFancy \ and ((format is None) or (format >= 1)) \ - and ((nsStrippedType in qqDumpers) or isQObjectDerived): + and ((nsStrippedType in qqDumpers) \ + or (str(type) in qqDumpers) \ + or isQObjectDerived): #warn("IS DUMPABLE: %s " % type) #self.putAddress(value.address) self.putType(realtype) if nsStrippedType in qqDumpers: qqDumpers[nsStrippedType](self, item) + if str(type) in qqDumpers: + qqDumpers[str(type)](self, item) elif isQObjectDerived: # value has references stripped off item.value. item1 = Item(value, item.iname) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index b2f23993fbc..bcbcf3d891a 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -2262,6 +2262,33 @@ def qdump__TLitC(d, item): d.putValue(encodeSymbianString(base, size), Hex4EncodedLittleEndian) +####################################################################### +# +# SSE +# +####################################################################### + +def qform____m128(): + return "As Floats,As Doubles" + +def qdump____m128(d, item): + d.putValue(" ") + d.putNumChild(1) + if d.isExpanded(item): + format = d.itemFormat(item) + if format == 2: # As Double + innerType = lookupType("double") + count = 2 + else: # Default, As float + innerType = lookupType("float") + count = 4 + p = item.value.address.cast(innerType.pointer()) + with Children(d, count, innerType): + for i in xrange(count): + d.putItem(Item(p.dereference(), item.iname)) + p += 1 + + ####################################################################### # # Display Test diff --git a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp index d118c8803db..6d2e9cb0a39 100644 --- a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp +++ b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp @@ -88,6 +88,11 @@ #undef max #endif +#ifdef Q_OS_LINUX +#include +#include +#endif + Q_DECLARE_METATYPE(QHostAddress) Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QStringList) @@ -1368,12 +1373,34 @@ QStack testQStack() return result; } -void testQString() + +void testQUrl() { QUrl url(QString("http://www.nokia.com")); + (void) url; +} + + +#ifdef FOP + +int xxxx() +{ +} + +#else + +int xxxx() +{ +} + + +#endif + + +void testQString() +{ QImage im; - // Could be broken due to Return Value Optimzation QString str = "Hello "; str += " big, "; str += " fat "; @@ -2034,6 +2061,24 @@ void testWCout0() cerr << "EEEEEE" << endl; } +void testSSE() +{ +#ifdef Q_OS_LINUX + float a[4]; + float b[4]; + int i; + for (i = 0; i < 4; i++) { + a[i] = 2 * i; + b[i] = 2 * i; + } + __m128 sseA, sseB; + sseA = _mm_loadu_ps(a); + sseB = _mm_loadu_ps(b); + ++i; +#endif +} + + void testQSettings() { // Note: Construct a QCoreApplication first. @@ -2048,6 +2093,7 @@ int main(int argc, char *argv[]) //testQSettings(); //testWCout0(); //testWCout(); + testSSE(); testQLocale(); testColor(); testQRegion(); @@ -2116,6 +2162,7 @@ int main(int argc, char *argv[]) testQMap(); testQMultiMap(); testQString(); + testQUrl(); testQSet(); # if QT_VERSION >= 0x040500 testQSharedPointer(); diff --git a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro index 2b4389eb348..d911cad8967 100644 --- a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro +++ b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro @@ -1,13 +1,11 @@ TEMPLATE = app TARGET = simple_gdbtest_app DEPENDPATH += . -INCLUDEPATH += . DESTDIR = . -# Input -SOURCES += \ - simple_gdbtest_app.cpp +SOURCES += simple_gdbtest_app.cpp -# SOURCES += ../../../share/qtcreator/gdbmacros/gdbmacros.cpp QT += network +unix: QMAKE_CXXFLAGS += -msse2 + message("this says ")