Commit f0b6bce0 authored by hjk's avatar hjk
Browse files

debugger: start with some infrastructure for tracepoint support

parent be1f6621
......@@ -83,6 +83,12 @@ QIcon BreakHandler::watchpointIcon()
return icon;
}
QIcon BreakHandler::tracepointIcon()
{
static QIcon icon(_(":/debugger/images/tracepoint.png"));
return icon;
}
QIcon BreakHandler::emptyIcon()
{
static QIcon icon(_(":/debugger/images/breakpoint_pending_16.png"));
......@@ -1064,6 +1070,8 @@ QIcon BreakHandler::BreakpointItem::icon() const
{
// FIXME: This seems to be called on each cursor blink as soon as the
// cursor is near a line with a breakpoint marker (+/- 2 lines or so).
if (data.isTracepoint())
return BreakHandler::tracepointIcon();
if (data.type == Watchpoint)
return BreakHandler::watchpointIcon();
if (!data.enabled)
......
......@@ -89,6 +89,7 @@ public:
static QIcon pendingBreakpointIcon();
static QIcon emptyIcon();
static QIcon watchpointIcon();
static QIcon tracepointIcon();
BreakpointId findBreakpointByFileAndLine(const QString &fileName,
int lineNumber, bool useMarkerPosition = true);
......
......@@ -43,7 +43,8 @@ namespace Internal {
BreakpointParameters::BreakpointParameters(BreakpointType t)
: type(t), enabled(true), useFullPath(false),
ignoreCount(0), lineNumber(0), address(0), threadSpec(-1)
ignoreCount(0), lineNumber(0), address(0), threadSpec(-1),
tracepoint(false)
{}
bool BreakpointParameters::equals(const BreakpointParameters &rhs) const
......@@ -57,7 +58,8 @@ bool BreakpointParameters::equals(const BreakpointParameters &rhs) const
&& lineNumber == rhs.lineNumber
&& address == rhs.address
&& threadSpec == rhs.threadSpec
&& functionName == rhs.functionName;
&& functionName == rhs.functionName
&& tracepoint == rhs.tracepoint;
}
bool BreakpointParameters::conditionsMatch(const QByteArray &other) const
......@@ -81,6 +83,7 @@ QString BreakpointParameters::toString() const
ts << " Address: " << address;
ts << " FunctionName: " << functionName;
ts << " UseFullPath: " << useFullPath;
ts << " Tracepoint: " << tracepoint;
return result;
}
......
......@@ -77,7 +77,9 @@ public:
bool equals(const BreakpointParameters &rhs) const;
bool conditionsMatch(const QByteArray &other) const;
bool isWatchpoint() const { return type == Watchpoint; }
bool isBreakpoint() const { return type != Watchpoint; } // Enough for now.
// Enough for now.
bool isBreakpoint() const { return type != Watchpoint && !tracepoint; }
bool isTracepoint() const { return tracepoint; }
QString toString() const;
bool operator==(const BreakpointParameters &p) const { return equals(p); }
......@@ -93,6 +95,7 @@ public:
quint64 address; // Address for watchpoints.
int threadSpec; // Thread specification.
QString functionName;
bool tracepoint;
};
......
......@@ -124,6 +124,20 @@
<item row="9" column="1">
<widget class="QLineEdit" name="lineEditThreadSpec"/>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkBoxTracepoint">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="labelTracepoint">
<property name="text">
<string>Tracepoint only:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
......@@ -196,6 +196,7 @@ void BreakpointDialog::clearParts(unsigned partsMask)
void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data) const
{
data->enabled = m_ui.checkBoxEnabled->isChecked();
data->tracepoint = m_ui.checkBoxTracepoint->isChecked();
if (partsMask & FileAndLinePart) {
data->lineNumber = m_ui.lineEditLineNumber->text().toInt();
......@@ -212,11 +213,12 @@ void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data)
void BreakpointDialog::setParts(unsigned mask, const BreakpointParameters &data)
{
m_ui.checkBoxEnabled->setChecked(data.enabled);
m_ui.checkBoxUseFullPath->setChecked(data.useFullPath);
if (mask & FileAndLinePart) {
m_ui.pathChooserFileName->setPath(data.fileName);
m_ui.lineEditLineNumber->setText(QString::number(data.lineNumber));
m_ui.checkBoxUseFullPath->setChecked(data.useFullPath);
m_ui.checkBoxTracepoint->setChecked(data.tracepoint);
}
if (mask & FunctionPart)
......
......@@ -19,6 +19,7 @@
<file>images/debugger_stop.png</file>
<file>images/debugger_stop_small.png</file>
<file>images/watchpoint.png</file>
<file>images/tracepoint.png</file>
<file>images/breakpoint_16.png</file>
<file>images/breakpoint_24.png</file>
<file>images/breakpoint_disabled_16.png</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment