From f0b6bce057d4dffd30482b5658bca5419d5ba0b4 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Thu, 16 Dec 2010 13:02:59 +0100 Subject: [PATCH] debugger: start with some infrastructure for tracepoint support --- src/plugins/debugger/breakhandler.cpp | 8 ++++++++ src/plugins/debugger/breakhandler.h | 1 + src/plugins/debugger/breakpoint.cpp | 7 +++++-- src/plugins/debugger/breakpoint.h | 5 ++++- src/plugins/debugger/breakpoint.ui | 14 ++++++++++++++ src/plugins/debugger/breakwindow.cpp | 4 +++- src/plugins/debugger/debugger.qrc | 1 + src/plugins/debugger/images/tracepoint.png | Bin 0 -> 641 bytes 8 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/plugins/debugger/images/tracepoint.png diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 3356f537648..6bfce8ea939 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -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) diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 9e8c24bb093..d8395992802 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -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); diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index 9c4d56b9e90..3af66d56dea 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -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; } diff --git a/src/plugins/debugger/breakpoint.h b/src/plugins/debugger/breakpoint.h index e4d873cb02f..d9c0386b248 100644 --- a/src/plugins/debugger/breakpoint.h +++ b/src/plugins/debugger/breakpoint.h @@ -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; }; diff --git a/src/plugins/debugger/breakpoint.ui b/src/plugins/debugger/breakpoint.ui index c1c63bd82bf..be26fbd8f54 100644 --- a/src/plugins/debugger/breakpoint.ui +++ b/src/plugins/debugger/breakpoint.ui @@ -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> diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index f9c8f851fab..a8f276ed993 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -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) diff --git a/src/plugins/debugger/debugger.qrc b/src/plugins/debugger/debugger.qrc index 7688ef39a42..c5aa9cc39ef 100644 --- a/src/plugins/debugger/debugger.qrc +++ b/src/plugins/debugger/debugger.qrc @@ -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> diff --git a/src/plugins/debugger/images/tracepoint.png b/src/plugins/debugger/images/tracepoint.png new file mode 100644 index 0000000000000000000000000000000000000000..f08d216bf399ff0e67423516af368f5cf8585b95 GIT binary patch literal 641 zcmV-{0)G98P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign} z3o$pCEn+JG00IF?L_t(I%f*vFOB-<*$3I>|1jBKWL<~3hBgmzLpd48mm;T;?aS{h# zK%kBe4!(#k8M<^U8M+Ei^+E`S93%z*TpJ>&oR<tSQI2qjC8R?&rCZUV-{s-q;rZ~u z_xr#rHS<&_FWf_U?FG?iqLi|@u&_{CUS3AiH1_xR0XR4~U^E)h@Av8TdOSWpegNKB zmh}T50wAR<3L#2{VbJMxa2$ur%S!+j7Z-^}qX;3$X0y!B&b}QC2JeLs*H>3p-xMij zW^Qh-w6wHDtyW_=9FoiBrY9y62?m1!^?IFVvq>tIBA?F_i9|k0DKiSNrRzGjZ6kzW zcXyX~JU#^^lSy3HMF_#l$_mwL72o&CX0rfA1-S5ipG+o0p-=$e_V#uPI669Fetw=t zqk(CfY;SMV?RFWBMgScJXx!i5W11#G5D)|b^?Ln}Uo*cQn@lDIL4c-dY;0^`+xAb( zvOX%7W%V4#X|>yJ!Z0KZL)O;Trhs%h&E4G{tE;Qid8^gp;o+e*bs-*)e?L7v-AN{s zN+OX!*L4mL4*^hB6~i!CUtecD9&>hfM!8%b13SL&Uq=9Z-@jH>_2m5g{9U)()c|bU z24HV*k60{*>$)5tA5*DRZh$S%^S=HS$!F=hz6tDjp11kb2fzhz1AO*8@5{fYbn=29 b`49R9$y(8<yK@OL00000NkvXXu0mjfi%AO< literal 0 HcmV?d00001 -- GitLab