From 36db421fce3630cab058f364d6f29dab2feac145 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 25 Nov 2009 15:43:39 +0100
Subject: [PATCH] debugger: make dumper exception passing configurable

---
 src/plugins/debugger/gdb/gdbengine.cpp | 12 ++++++++++--
 tests/auto/debugger/tst_gdb.cpp        | 16 ++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index fe167734eb1..b8fa6fa6747 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -3543,7 +3543,7 @@ void GdbEngine::updateLocals(const QVariant &cookie)
         manager()->watchHandler()->beginCycle();
         m_toolTipExpression.clear();
         QStringList expanded = m_manager->watchHandler()->expandedINames().toList();
-        postCommand(_("-interpreter-exec console \"bb %1 %2\"")
+        postCommand(_("-interpreter-exec console \"bb %1 0 %2\"")
                 .arg(int(theDebuggerBoolSetting(UseDebuggingHelpers)))
                 .arg(expanded.join(_(","))),
             CB(handleStackFrame));
@@ -4327,7 +4327,11 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
         return false;
     }
 
-    // Do this only after the process is running, so we get no needless error notifications
+    const QString dumperSourcePath =
+        Core::ICore::instance()->resourcePath() + _("/gdbmacros/");
+
+    // Do this only after the process is running, so we get no needless error
+    // notifications
     connect(&m_gdbProc, SIGNAL(error(QProcess::ProcessError)),
         SLOT(handleGdbError(QProcess::ProcessError)));
     connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
@@ -4340,6 +4344,10 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
     debugMessage(_("GDB STARTED, INITIALIZING IT"));
 
     postCommand(_("show version"), CB(handleShowVersion));
+
+    postCommand(_("source -p ") + dumperSourcePath + _("dumper.py"));
+    postCommand(_("source -p ") + dumperSourcePath + _("gdbmacros.py"));
+
     postCommand(_("-interpreter-exec console \"help bb\""),
         CB(handleIsSynchroneous));
     //postCommand(_("-enable-timings");
diff --git a/tests/auto/debugger/tst_gdb.cpp b/tests/auto/debugger/tst_gdb.cpp
index 8144fb6a533..e56859f816a 100644
--- a/tests/auto/debugger/tst_gdb.cpp
+++ b/tests/auto/debugger/tst_gdb.cpp
@@ -665,7 +665,7 @@ void tst_Gdb::run(const QByteArray &label, const QByteArray &expected0,
 {
     //qDebug() << "\nABOUT TO RUN TEST: " << expanded;
     qWarning() << label << "...";
-    writeToGdb("bb " + N(int(fancy)) + " " + expanded);
+    writeToGdb("bb " + N(int(fancy)) + " 1 " + expanded);
     m_mutex.lock();
     m_waitCondition.wait(&m_mutex);
     QByteArray ba = m_thread.m_output;
@@ -1077,13 +1077,6 @@ QByteArray dump_QAbstractItemModelHelper(QAbstractItemModel &m)
 }
 */
 
-#ifdef QT_GUI_LIB
-QStandardItem item1("Item (0,0)");
-QStandardItem item2("Item (0,1)");
-QStandardItem item3("Item (1,0)");
-QStandardItem item4("Item (1,1)");
-#endif
-
 void dump_QAbstractItemModel()
 {
     #ifdef QT_GUI_LIB
@@ -1094,10 +1087,9 @@ void dump_QAbstractItemModel()
     /* B */ model1.setStringList(strList);
     /* C */ strList << "String 2";
     /* D */ model1.setStringList(strList);
-    /* E */ model2.appendRow(QList<QStandardItem *>() << &item1 << &item2);
-    /* F */ model2.appendRow(QList<QStandardItem *>() << &item3 << &item4);
-    /* G */ (void) (model1.rowCount() + model2.rowCount() + item1.row()
-                + item2.row() + item3.row() + item4.row() + strList.size());
+    /* E */ model2.appendRow(QList<QStandardItem *>() << (new QStandardItem("Item (0,0)")) << (new QStandardItem("Item (0,1)")));
+    /* F */ model2.appendRow(QList<QStandardItem *>() << (new QStandardItem("Item (1,0)")) << (new QStandardItem("Item (1,1)")));
+    /* G */ (void) (model1.rowCount() + model2.rowCount() + strList.size());
     #endif
 }
 
-- 
GitLab