debugger: The DebuggerEngine refactoring.

This replaces the (de facto) singleton engines and data handlers by classes
that are instantiated per run. The DebuggerRunControl will now create an
object of (a class derived from) DebuggerEngine that contains all the relevant
"dynamic" data.

DebuggerManager is no more. The "singleton" bits are merged into DebuggerPlugin,
whereas the data bits went to DebuggerEngine.

There is no formal notion of a "current" DebuggerEngine. However, as there's
only one DebuggerEngine at a time that has its data models connected to the
view, there's still some "de facto" notion of a "current" engine. Calling
SomeModel::setData(int role, QVariant data) with custom role is used as the
primary dispatch mechanism from the views to the "current" data models
(and the engine, as all data models know their engine).
This commit is contained in:
hjk
2010-06-16 11:08:54 +02:00
parent 4cc244469a
commit 6a6cba5518
93 changed files with 5258 additions and 4846 deletions

View File

@@ -138,36 +138,132 @@ enum DebuggerCapabilities
enum LogChannel
{
LogInput, // Used for user input
LogMiscInput, // Used for misc stuff in the input pane
LogOutput,
LogWarning,
LogError,
LogStatus, // Used for status changed messages
LogTime, // Used for time stamp messages
LogDebug,
LogMisc,
AppOutput,
AppError,
StatusBar // LogStatus and also put to the status bar
};
LogInput, // Used for user input
LogMiscInput, // Used for misc stuff in the input pane
LogOutput,
LogWarning,
LogError,
LogStatus, // Used for status changed messages
LogTime, // Used for time stamp messages
LogDebug,
LogMisc,
AppOutput,
AppError,
AppStuff,
StatusBar // LogStatus and also put to the status bar
};
enum ModelRoles
{
DisplaySourceRole = 32, // Qt::UserRole
enum ModelRoles
{
DisplaySourceRole = 32, // Qt::UserRole,
EngineCapabilityRole,
EngineStateRole,
EngineCapabilitiesRole,
EngineActionsEnabledRole,
// Running
RequestExecContinueRole,
RequestExecInterruptRole,
RequestExecResetRole,
RequestExecStepRole,
RequestExecStepOutRole,
RequestExecNextRole,
RequestExecRunToLineRole,
RequestExecRunToFunctionRole,
RequestExecReturnFromFunctionRole,
RequestExecJumpToLineRole,
RequestExecWatchRole,
RequestExecSnapshotRole,
RequestExecFrameDownRole,
RequestExecFrameUpRole,
RequestExecDetachRole,
RequestExecExitRole,
RequestLoadSessionDataRole,
RequestSaveSessionDataRole,
// Breakpoints
BreakpointEnabledRole,
BreakpointUseFullPathRole,
BreakpointFunctionNameRole,
BreakpointFileNameRole,
BreakpointConditionRole,
BreakpointIgnoreCountRole,
BreakpointThreadSpecRole,
RequestActivateBreakpointRole,
RequestRemoveBreakpointRole,
RequestRemoveBreakpointByIndexRole,
RequestSynchronizeBreakpointsRole,
RequestBreakByFunctionRole,
RequestBreakByFunctionMainRole,
RequestFindSimilarBreakpointRole,
RequestAppendBreakpointRole,
RequestUpdateBreakpointRole,
// Locals and Watchers
LocalsINameRole,
LocalsExpressionRole,
LocalsExpandedRole, // The preferred expanded state to the view
LocalsTypeFormatListRole,
LocalsTypeFormatRole, // Used to communicate alternative formats to the view
LocalsIndividualFormatRole,
LocalsAddressRole, // Memory address of variable as quint64
LocalsRawValueRole, // Unformatted value as string
LocalsPointerValueRole, // Pointer value (address) as quint64
LocalsIsWatchpointAtAddressRole,
LocalsIsWatchpointAtPointerValueRole,
RequestToggleWatchRole,
RequestClearCppCodeModelSnapshotRole,
RequestAssignValueRole,
RequestAssignTypeRole,
// Stack
StackFrameAddressRole,
RequestActivateFrameRole,
RequestReloadFullStackRole,
RequestShowMemoryRole,
RequestShowDisassemblerRole,
// Threads
CurrentThreadIdRole,
RequestSelectThreadRole,
// Modules
RequestReloadModulesRole,
RequestModuleSymbolsRole,
RequestAllSymbolsRole,
RequestOpenFileRole,
// Registers
RegisterNumberBaseRole, // Currently used number base
RegisterAddressRole, // Start value for opening memory view
RegisterChangedRole, // Used for painting changed values
RequestSetRegisterRole,
RequestReloadRegistersRole,
// Snapshots
RequestMakeSnapshotRole,
RequestActivateSnapshotRole,
RequestRemoveSnapshotRole,
// Sources
RequestReloadSourceFilesRole,
};
enum DebuggerEngineType
{
NoEngineType = 0,
GdbEngineType = 0x01,
ScriptEngineType = 0x02,
CdbEngineType = 0x04,
PdbEngineType = 0x08,
TcfEngineType = 0x10,
QmlEngineType = 0x20,
AllEngineTypes = GdbEngineType
| ScriptEngineType
| CdbEngineType
| PdbEngineType
| TcfEngineType
| QmlEngineType
};
} // namespace Debugger