From f130cd16a84b26386bbf071ff2cdfd50f6ec4874 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 29 Mar 2011 14:57:15 +0200 Subject: [PATCH] debugger: add QXmlAttributes manual test --- share/qtcreator/gdbmacros/gdbmacros.py | 2 + src/plugins/debugger/gdb/gdbengine.cpp | 6 +- .../simple/deep/deep/simple_gdbtest_app.h | 126 ++++++++++++++++++ .../gdbdebugger/simple/simple_gdbtest_app.cpp | 15 ++- .../gdbdebugger/simple/simple_gdbtest_app.pro | 2 + 5 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 tests/manual/gdbdebugger/simple/deep/deep/simple_gdbtest_app.h diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index e5e5cd6a158..af161f1e4da 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -1688,6 +1688,8 @@ def qdump__QWeakPointer(d, item): d.putIntItem("strongref", strongref) +def qdump__QxXmlAttributes(d, item): + pass ####################################################################### # diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 74245bdd346..d3c6632f903 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2458,9 +2458,9 @@ void GdbEngine::handleBreakListMultiple(const GdbResponse &response) QTC_ASSERT(response.resultClass == GdbResultDone, /**/) const BreakpointId id = response.cookie.toInt(); BreakHandler *handler = breakHandler(); - BreakpointResponse br = handler->response(id); - br.addresses.append(0); - handler->setResponse(id, br); + const QString str = QString::fromLocal8Bit( + response.data.findChild("consolestreamoutput").data()); + extractDataFromInfoBreak(str, id); } void GdbEngine::handleBreakDisable(const GdbResponse &response) diff --git a/tests/manual/gdbdebugger/simple/deep/deep/simple_gdbtest_app.h b/tests/manual/gdbdebugger/simple/deep/deep/simple_gdbtest_app.h new file mode 100644 index 00000000000..0fe9c7b81e8 --- /dev/null +++ b/tests/manual/gdbdebugger/simple/deep/deep/simple_gdbtest_app.h @@ -0,0 +1,126 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef SIMPLE_DEBUGGER_TEST_H +#define SIMPLE_DEBUGGER_TEST_H + +struct SomeClassWithInlineConstructor +{ + SomeClassWithInlineConstructor() + { + a = 21; + } + int a; +}; + +struct SomeBaseClassWithInlineConstructor +{ + SomeBaseClassWithInlineConstructor() + { + a = 21; + } + virtual ~SomeBaseClassWithInlineConstructor(); + int a; +}; + +struct SomeDerivedClassWithInlineConstructor + : SomeBaseClassWithInlineConstructor +{ + SomeDerivedClassWithInlineConstructor() + { + a = 21; + } + virtual ~SomeDerivedClassWithInlineConstructor(); + int a; +}; + +template +struct SomeTemplatedClassWithInlineConstructor +{ + SomeTemplatedClassWithInlineConstructor() + { + a = 21; + } + T a; +}; + +template +struct SomeTemplatedBaseClassWithInlineConstructor +{ + SomeTemplatedBaseClassWithInlineConstructor() + { + a = 21; + } + virtual ~SomeTemplatedBaseClassWithInlineConstructor(); + + T a; +}; + +template +struct SomeTemplatedDerivedClassWithInlineConstructor + : SomeTemplatedBaseClassWithInlineConstructor +{ + SomeTemplatedDerivedClassWithInlineConstructor() + { + a = 21; + } + virtual ~SomeTemplatedDerivedClassWithInlineConstructor(); + T a; +}; + + +SomeBaseClassWithInlineConstructor::~SomeBaseClassWithInlineConstructor() {} + +SomeDerivedClassWithInlineConstructor::~SomeDerivedClassWithInlineConstructor() {} + +template +SomeTemplatedBaseClassWithInlineConstructor:: + ~SomeTemplatedBaseClassWithInlineConstructor() {} + +template +SomeTemplatedDerivedClassWithInlineConstructor:: + ~SomeTemplatedDerivedClassWithInlineConstructor() {} + +void testInlineBreakpoints() +{ + SomeClassWithInlineConstructor a; + SomeBaseClassWithInlineConstructor b; + SomeDerivedClassWithInlineConstructor c; + SomeTemplatedClassWithInlineConstructor d; + SomeTemplatedBaseClassWithInlineConstructor e; + SomeTemplatedDerivedClassWithInlineConstructor f; + int i = a.a + b.a + c.a + d.a + e.a + f.a; + ++i; +} + +#endif // SIMPLE_DEBUGGER_TEST_H diff --git a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp index 72eaf32dbf3..b32d1e29a2f 100644 --- a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp +++ b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp @@ -35,7 +35,7 @@ //template class B; B foo() {} -#include "simple_gdbtest_app.h" +#include "../deeper/simple_gdbtest_app.h" #include #include @@ -76,6 +76,8 @@ #include #include +#include + #include #include @@ -1236,6 +1238,16 @@ void testQSharedPointer() } #endif +void testQXmlAttributes() +{ + QXmlAttributes atts; + atts.append("name1", "uri1", "localPart1", "value1"); + atts.append("name2", "uri2", "localPart2", "value2"); + atts.append("name3", "uri3", "localPart3", "value3"); + int n = atts.count(); + ++n; +} + void stringRefTest(const QString &refstring) { Q_UNUSED(refstring); @@ -2547,6 +2559,7 @@ void testMPI() int main(int argc, char *argv[]) { + testQXmlAttributes(); testQRegExp(); testInlineBreakpoints(); testLongEvaluation(); diff --git a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro index 5c2d3a9e52c..5215b43b6d6 100644 --- a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro +++ b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.pro @@ -1,12 +1,14 @@ TEMPLATE = app TARGET = simple_gdbtest_app DEPENDPATH += . +INCLUDEPATH += . DESTDIR = . SOURCES += simple_gdbtest_app.cpp QT += network QT += script +QT += xml #unix: QMAKE_CXXFLAGS += -msse2 #DEFINES += USE_BOOST=1