breakpoint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _BREAKPOINT_H_
00019 #define _BREAKPOINT_H_
00020
00021 #include <qstring.h>
00022 #include <qlistbox.h>
00023
00024
00025
00026
00027
00028 namespace JAVADebugger
00029 {
00030
00031 class Breakpoint : public QListBoxItem
00032 {
00033 public:
00034 Breakpoint(bool temporary=false, bool enabled=true);
00035 virtual ~Breakpoint();
00036
00037 virtual QString dbgSetCommand() const = 0;
00038 virtual QString dbgRemoveCommand() const;
00039 virtual bool match(const Breakpoint* brkpt) const = 0;
00040 virtual QString text () const;
00041 virtual void configureDisplay();
00042 virtual bool modifyDialog();
00043 virtual void reset();
00044
00045 int height(const QListBox *lb) const;
00046 int width(const QListBox *lb) const;
00047 void paint(QPainter *p);
00048
00049 void setActive(int active, int id);
00050 bool isActive(int active) const { return ( (active_ == active) ||
00051 (s_pending_ && !s_actionClear_) ); }
00052
00053 void setEnabled(bool enabled) { s_changedEnable_ = (s_enabled_ != enabled); s_enabled_ = enabled; }
00054 bool isEnabled() const { return s_enabled_; }
00055 void setTemporary(bool temporary) { s_temporary_ = temporary; }
00056 bool isTemporary() const { return s_temporary_; }
00057 void setHardwareBP(bool hardwareBP) { s_hardwareBP_ = hardwareBP; }
00058 bool isHardwareBP() const { return s_hardwareBP_; }
00059 void setIgnoreCount(int ignoreCount) { s_changedIgnoreCount_ = (ignoreCount_ != ignoreCount); ignoreCount_ = ignoreCount; }
00060 int ignoreCount() const { return ignoreCount_; }
00061 void setAddress(const QString &address) { address_ = address; }
00062 QString address() const { return address_; }
00063 void setConditional(const QString &condition) { s_changedCondition_ = (condition_ != condition); condition_ = condition; }
00064 QString conditional() const { return condition_; }
00065
00066 bool changedCondition() { return s_changedCondition_; }
00067 bool changedIgnoreCount() { return s_changedIgnoreCount_; }
00068 bool changedEnable() { return s_changedEnable_; }
00069
00070 void setPending(bool pending) { s_pending_ = pending; }
00071 bool isPending() const { return s_pending_; }
00072 void setActionAdd(bool actionAdd) { s_actionAdd_ = actionAdd; }
00073 bool isActionAdd() const { return s_actionAdd_; }
00074 void setActionClear(bool actionClear) { s_actionClear_ = actionClear; }
00075 bool isActionClear() const { return s_actionClear_; }
00076 void setActionModify(bool actionModify) { s_actionModify_ = actionModify; }
00077 bool isActionModify() const { return s_actionModify_; }
00078 void setDbgProcessing(bool dbgProcessing) { s_dbgProcessing_ = dbgProcessing; }
00079 bool isDbgProcessing() const { return s_dbgProcessing_; }
00080 void setActionDie() { s_actionDie_ = true; s_actionClear_ = false; }
00081 bool isActionDie() const { return s_actionDie_; }
00082
00083 int key() const { return key_; }
00084 void setDbgId(int dbgId) { dbgId_ = dbgId; }
00085 int dbgId() const { return dbgId_; }
00086 void setHits(int hits) { hits_ = hits; }
00087 int hits() const { return hits_; }
00088
00089 virtual bool hasSourcePosition() const;
00090 virtual QString fileName() const;
00091 virtual int lineNum() const;
00092
00093 protected:
00094
00095
00096
00097
00098 QString display_;
00099
00100 private:
00101 bool s_pending_ :1;
00102 bool s_actionAdd_ :1;
00103 bool s_actionClear_ :1;
00104 bool s_actionModify_ :1;
00105 bool s_actionDie_ :1;
00106 bool s_dbgProcessing_ :1;
00107 bool s_enabled_ :1;
00108 bool s_temporary_ :1;
00109 bool s_changedCondition_ :1;
00110 bool s_changedIgnoreCount_ :1;
00111 bool s_changedEnable_ :1;
00112 bool s_hardwareBP_ :1;
00113
00114 int dbgId_;
00115 int hits_;
00116
00117 int key_;
00118 int active_;
00119
00120 int ignoreCount_;
00121 QString address_;
00122 QString condition_;
00123 };
00124
00125
00126
00127
00128 class FilePosBreakpoint : public Breakpoint
00129 {
00130 public:
00131 FilePosBreakpoint(const QString &fileName, int lineNum,
00132 bool temporary=false, bool enabled=true);
00133 virtual ~FilePosBreakpoint();
00134 virtual QString dbgSetCommand() const;
00135 virtual bool match(const Breakpoint *brkpt) const;
00136 virtual void configureDisplay();
00137
00138 QString fileName() const { return fileName_; }
00139 int lineNum() const { return lineNo_; }
00140 bool hasSourcePosition() const { return true; }
00141
00142 private:
00143 QString fileName_;
00144 int lineNo_;
00145 };
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184 class Watchpoint : public Breakpoint
00185 {
00186 public:
00187 Watchpoint(const QString &varName, bool temporary=false, bool enabled=true);
00188 virtual ~Watchpoint();
00189 virtual QString dbgSetCommand() const;
00190 bool match(const Breakpoint *brkpt) const;
00191 virtual void configureDisplay();
00192
00193 private:
00194 QString varName_;
00195 };
00196
00197 }
00198
00199
00200
00201
00202
00203 #endif
This file is part of the documentation for KDevelop Version 3.1.2.