Debugger: Add infrastructure for message tracepoints.

Add context menu to add a 'message tracepoint', that is,
a trace point that outputs a user message and continues.
Intended to be a replacement for manually inserting
a qDebug() into the code to understand the call sequence.
Yet to be implemented for gdb.

Change-Id: I1c303001421fbbae74d98d15d52718579350db6e
Rubber-stamped-by: hjk
Reviewed-on: http://codereview.qt.nokia.com/756
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint
2011-06-27 10:37:57 +02:00
parent bcb46f3ebb
commit 90ee1cc1c9
11 changed files with 123 additions and 11 deletions

View File

@@ -329,6 +329,8 @@ void BreakHandler::saveBreakpoints()
map.insert(_("command"), data.command);
if (!data.expression.isEmpty())
map.insert(_("expression"), data.expression);
if (!data.message.isEmpty())
map.insert(_("message"), data.message);
list.append(map);
}
debuggerCore()->setSessionValue("Breakpoints", list);
@@ -387,6 +389,9 @@ void BreakHandler::loadBreakpoints()
v = map.value(_("expression"));
if (v.isValid())
data.expression = v.toString();
v = map.value(_("message"));
if (v.isValid())
data.message = v.toString();
appendBreakpoint(data);
}
//qDebug() << "LOADED BREAKPOINTS" << this << list.size();
@@ -719,6 +724,7 @@ PROPERTY(QByteArray, condition, setCondition)
GETTER(int, lineNumber)
PROPERTY(quint64, address, setAddress)
PROPERTY(QString, expression, setExpression)
PROPERTY(QString, message, setMessage)
PROPERTY(int, ignoreCount, setIgnoreCount)
bool BreakHandler::isEnabled(BreakpointModelId id) const
@@ -1494,6 +1500,12 @@ QString BreakHandler::BreakpointItem::toToolTip() const
<< "</td><td>" << response.command
<< "</td></tr>";
}
if (!data.message.isEmpty() || !response.message.isEmpty()) {
str << "<tr><td>" << tr("Message:")
<< "</td><td>" << data.message
<< "</td><td>" << response.message
<< "</td></tr>";
}
if (!data.condition.isEmpty() || !response.condition.isEmpty()) {
str << "<tr><td>" << tr("Condition:")
<< "</td><td>" << data.condition