summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-11-02 16:14:43 +0100
committerhjk <qthjk@ovi.com>2012-11-02 16:22:12 +0100
commit41a5461cf2e4bebbe8233ae2974baeca056691ab (patch)
tree445037d052bfb91c12fee57618ee4963d2caf68b /src/plugins/debugger/gdb
parent2e40c54ea3422f7a3e8441cf81c0b07e4491f287 (diff)
downloadqt-creator-41a5461cf2e4bebbe8233ae2974baeca056691ab.tar.gz
Debugger: Log exceptions in build pane.
- Introduce constants for task categories, add "RunTime". - Log exceptions under "RunTime". - Clear pane on debugger start. - Add 'first chance' Task-number: QTCREATORBUG-8141 Change-Id: Icf68def06c42a0f3bb86dcc2ae74750b5397ca52 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/gdb')
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index e01c595e3f..73bb0652e5 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -344,14 +344,18 @@ static void dump(const char *first, const char *middle, const QString & to)
// Parse "~:gdb: unknown target exception 0xc0000139 at 0x77bef04e\n"
// and return an exception message
-static inline QString msgWinException(const QByteArray &data)
+static inline QString msgWinException(const QByteArray &data, unsigned *exCodeIn = 0)
{
+ if (exCodeIn)
+ *exCodeIn = 0;
const int exCodePos = data.indexOf("0x");
const int blankPos = exCodePos != -1 ? data.indexOf(' ', exCodePos + 1) : -1;
const int addressPos = blankPos != -1 ? data.indexOf("0x", blankPos + 1) : -1;
if (addressPos < 0)
return GdbEngine::tr("An exception was triggered.");
const unsigned exCode = data.mid(exCodePos, blankPos - exCodePos).toUInt(0, 0);
+ if (exCodeIn)
+ *exCodeIn = exCode;
const quint64 address = data.mid(addressPos).trimmed().toULongLong(0, 0);
QString rc;
QTextStream str(&rc);
@@ -692,8 +696,13 @@ void GdbEngine::handleResponse(const QByteArray &buff)
// [Windows, most likely some DLL/Entry point not found]:
// "gdb: unknown target exception 0xc0000139 at 0x77bef04e"
// This may be fatal and cause the target to exit later
- m_lastWinException = msgWinException(data);
+ unsigned exCode;
+ m_lastWinException = msgWinException(data, &exCode);
showMessage(m_lastWinException, LogMisc);
+ const Task::TaskType type = isFatalWinException(exCode) ? Task::Error : Task::Warning;
+ const Task task(type, m_lastWinException, Utils::FileName(), 0,
+ Core::Id(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME));
+ taskHub()->addTask(task);
}
if (data.startsWith("QMLBP:")) {
@@ -735,7 +744,7 @@ void GdbEngine::handleResponse(const QByteArray &buff)
Task task(Task::Warning,
tr("Missing debug information for %1\nTry: %2")
.arg(m_lastMissingDebugInfo).arg(cmd),
- FileName(), 0, Core::Id("Debuginfo"));
+ FileName(), 0, Core::Id(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO));
taskHub()->addTask(task);