debuggger: code cosmetics

This commit is contained in:
hjk
2010-03-26 08:52:49 +01:00
parent acc4563f37
commit 1883baa56e
2 changed files with 90 additions and 81 deletions

View File

@@ -30,8 +30,6 @@
#ifndef DEBUGGER_BREAKHANDLER_H
#define DEBUGGER_BREAKHANDLER_H
#include <utils/qtcassert.h>
#include <QtCore/QObject>
#include <QtCore/QAbstractTableModel>
#include <QtGui/QIcon>
@@ -66,41 +64,42 @@ public:
private:
// Intentionally unimplemented.
// Making it copiable is tricky because of the markers.
// Making it copyable is tricky because of the markers.
void operator=(const BreakpointData &);
BreakpointData(const BreakpointData &);
// Our owner
BreakHandler *m_handler; // not owned.
BreakHandler *m_handler; // Not owned.
public:
bool enabled; // should we talk to the debugger engine?
bool pending; // does the debugger engine know about us already?
bool enabled; // Should we talk to the debugger engine?
bool pending; // Does the debugger engine know about us already?
// this "user requested information". will get stored in the session
QString fileName; // short name of source file
QByteArray condition; // condition associated with breakpoint
QByteArray ignoreCount; // ignore count associated with breakpoint
QByteArray lineNumber; // line in source file
QString funcName; // name of containing function
bool useFullPath; // should we use the full path when setting the bp?
// This "user requested information" will get stored in the session.
QString fileName; // Short name of source file.
QByteArray condition; // Condition associated with breakpoint.
QByteArray ignoreCount; // Ignore count associated with breakpoint.
QByteArray lineNumber; // Line in source file.
QString funcName; // Name of containing function.
bool useFullPath; // Should we use the full path when setting the bp?
// this is what gdb produced in response
QByteArray bpNumber; // breakpoint number assigned by the debugger engine
QByteArray bpCondition; // condition acknowledged by the debugger engine
QByteArray bpIgnoreCount;// ignore count acknowledged by the debugger engine
QString bpFileName; // file name acknowledged by the debugger engine
QByteArray bpLineNumber; // line number acknowledged by the debugger engine
QString bpFuncName; // function name acknowledged by the debugger engine
QByteArray bpAddress; // address acknowledged by the debugger engine
bool bpMultiple; // happens in constructors/gdb
bool bpEnabled; // enable/disable command sent
// This is what gdb produced in response.
QByteArray bpNumber; // Breakpoint number assigned by the debugger engine.
QByteArray bpCondition; // Condition acknowledged by the debugger engine.
QByteArray bpIgnoreCount;// Ignore count acknowledged by the debugger engine.
QString bpFileName; // File name acknowledged by the debugger engine.
QByteArray bpLineNumber; // Line number acknowledged by the debugger engine.
QByteArray bpCorrectedLineNumber; // Acknowledged by the debugger engine.
QString bpFuncName; // Function name acknowledged by the debugger engine.
QByteArray bpAddress; // Address acknowledged by the debugger engine.
bool bpMultiple; // Happens in constructors/gdb.
bool bpEnabled; // Enable/disable command sent.
// taken from either user input or gdb responses
QString markerFileName; // used to locate the marker
// Taken from either user input or gdb responses.
QString markerFileName; // Used to locate the marker.
int markerLineNumber;
// our red blob in the editor
// Our red blob in the editor.
BreakpointMarker *marker;
};
@@ -126,23 +125,23 @@ public:
QAbstractItemModel *model() { return this; }
BreakpointData *at(int index) const { QTC_ASSERT(index < size(), return 0); return m_bp.at(index); }
BreakpointData *at(int index) const;
int size() const { return m_bp.size(); }
bool hasPendingBreakpoints() const;
void append(BreakpointData *data);
void removeAt(int index); // also deletes the marker
void clear(); // also deletes all the marker
void removeAt(int index); // This also deletes the marker.
void clear(); // This also deletes all the marker.
int indexOf(BreakpointData *data) { return m_bp.indexOf(data); }
int findBreakpoint(const QString &fileName, int lineNumber);
int findBreakpoint(const BreakpointData &data); // returns index
int findBreakpoint(int bpNumber); // returns index
int findBreakpoint(const BreakpointData &data); // Returns index.
int findBreakpoint(int bpNumber); // Returns index.
void updateMarkers();
QList<BreakpointData *> insertedBreakpoints() const;
void takeInsertedBreakPoint(BreakpointData *);
QList<BreakpointData *> takeRemovedBreakpoints(); // owned
QList<BreakpointData *> takeEnabledBreakpoints(); // not owned
QList<BreakpointData *> takeDisabledBreakpoints(); // not owned
QList<BreakpointData *> takeRemovedBreakpoints(); // Owned.
QList<BreakpointData *> takeEnabledBreakpoints(); // Not owned.
QList<BreakpointData *> takeDisabledBreakpoints(); // Not owned.
QIcon breakpointIcon() const { return m_breakpointIcon; }
QIcon disabledBreakpointIcon() const { return m_disabledBreakpointIcon; }
@@ -177,12 +176,12 @@ private:
const QIcon m_disabledBreakpointIcon;
const QIcon m_pendingBreakPointIcon;
DebuggerManager *m_manager; // not owned
DebuggerManager *m_manager; // Not owned.
QList<BreakpointData *> m_bp;
QList<BreakpointData *> m_inserted; // lately inserted breakpoints
QList<BreakpointData *> m_removed; // lately removed breakpoints
QList<BreakpointData *> m_enabled; // lately enabled breakpoints
QList<BreakpointData *> m_disabled; // lately disabled breakpoints
QList<BreakpointData *> m_inserted; // Lately inserted breakpoints.
QList<BreakpointData *> m_removed; // Lately removed breakpoints.
QList<BreakpointData *> m_enabled; // Lately enabled breakpoints.
QList<BreakpointData *> m_disabled; // Lately disabled breakpoints.
};
} // namespace Internal