Debugger[CDB]: Refactor breakpoint handling.

Add a command to list breakpoints enabling id access.
Implemented breakpoint handling similar to gdb using breakpoint
ids (no longer delete and re-set all breakpoints on a change).
Save the module that is reported back in the session so that
it can be re-used for the next start. Keep a per-debugger-session
cache of fileName->Module for adding breakpoints to accelerate
setting breakpoints in the same file.
Polish the breakpoint tooltip.
This commit is contained in:
Friedemann Kleint
2011-02-03 16:26:23 +01:00
parent d5a33d2860
commit 91ead6c818
12 changed files with 327 additions and 142 deletions

View File

@@ -35,6 +35,7 @@
#define DEBUGGER_CDBENGINE_H
#include "debuggerengine.h"
#include "breakpoint.h"
#include <QtCore/QSharedPointer>
#include <QtCore/QProcess>
@@ -68,7 +69,8 @@ public:
CommandListStack = 0x1,
CommandListThreads = 0x2,
CommandListRegisters = 0x4,
CommandListModules = 0x8
CommandListModules = 0x8,
CommandListBreakPoints = 0x10
};
typedef QSharedPointer<CdbBuiltinCommand> CdbBuiltinCommandPtr;
@@ -159,6 +161,8 @@ private slots:
void consoleStubExited();
private:
typedef QHash<BreakpointId, BreakpointResponse> PendingBreakPointMap;
enum SpecialStopMode
{
NoSpecialStop,
@@ -205,6 +209,8 @@ private:
void handleModules(const CdbExtensionCommandPtr &reply);
void handleMemory(const CdbExtensionCommandPtr &);
void handleWidgetAt(const CdbExtensionCommandPtr &);
void handleBreakPoints(const CdbExtensionCommandPtr &);
void handleBreakPoints(const GdbMi &value);
QString normalizeFileName(const QString &f);
void updateLocalVariable(const QByteArray &iname);
@@ -227,7 +233,6 @@ private:
bool m_accessible;
SpecialStopMode m_specialStopMode;
int m_nextCommandToken;
int m_nextBreakpointNumber;
QList<CdbBuiltinCommandPtr> m_builtinCommandQueue;
int m_currentBuiltinCommandIndex; // Current command whose output is recorded.
QList<CdbExtensionCommandPtr> m_extensionCommandQueue;
@@ -244,6 +249,8 @@ private:
unsigned m_wX86BreakpointCount;
int m_watchPointX;
int m_watchPointY;
PendingBreakPointMap m_pendingBreakpointMap;
QHash<QString, QString> m_fileNameModuleHash;
};
} // namespace Internal