1
/***************************************************************************
2
* Copyright (C) 1999-2001 by John Birch *
4
* Copyright (C) 2001 by Bernd Gehrmann *
7
* This program is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
12
***************************************************************************/
14
#ifndef _DEBUGGERPART_H_
15
#define _DEBUGGERPART_H_
17
#include <qguardedptr.h>
18
#include "kdevplugin.h"
21
#include "gdbcontroller.h"
22
#include "debuggerdcopinterface.h"
24
namespace KParts { class Part; }
30
class ProcessLineMaker;
31
class KDevAppFrontend;
37
class GDBBreakpointWidget;
38
class FramestackWidget;
39
class DisassembleWidget;
44
class GDBOutputWidget;
47
class DebuggerPart : public KDevPlugin, virtual public DebuggerDCOPInterface
52
DebuggerPart( QObject *parent, const char *name, const QStringList & );
54
virtual void restorePartialProjectSession(const QDomElement* el);
55
virtual void savePartialProjectSession(QDomElement* el);
58
virtual ASYNC slotDebugExternalProcess();
59
virtual ASYNC slotDebugCommandLine(const QString& command);
63
void guiClientAdded(KXMLGUIClient*);
64
void contextMenu(QPopupMenu *popup, const Context *context);
65
void toggleBreakpoint();
66
void contextEvaluate();
68
// void projectOpened();
70
void projectConfigWidget(KDialogBase *dlg);
71
void slotActivePartChanged(KParts::Part*);
74
// Called to finish run operation in the case when we're
75
// starting the debugger. Called either directly from
76
// slotRun, if no rebuilding of project is needed, or
77
// indirectly from project()->projectCompiled() after project
81
void slotExamineCore();
82
void slotAttachProcess();
83
void slotStopDebugger();
84
void slotStop(KDevPlugin* which = 0);
86
void slotRunToCursor();
87
void slotJumpToCursor();
89
void slotStepOverInstruction();
90
void slotStepIntoInstruction();
93
void slotMemoryView();
95
void slotRefreshBPState(const Breakpoint&);
97
void slotStatus(const QString &msg, int state);
98
void slotShowStep(const QString &fileName, int lineNum);
99
void slotGotoSource(const QString &fileName, int lineNum);
101
void slotDCOPApplicationRegistered(const QCString &appId);
102
void slotCloseDrKonqi();
104
// Hide or show the view that's the sender of this signal.
105
void slotShowView(bool enabled);
107
void slotDebuggerAbnormalExit();
109
// Called when some file in the project was saved.
110
// Sets 'needRebuild_' to true.
111
void slotFileSaved();
113
void slotProjectCompiled();
115
void slotEvent(GDBController::event_t);
118
KDevAppFrontend *appFrontend();
119
KDevDebugger *debugger();
121
bool attachProcess(int pid);
122
bool startDebugger();
123
void setupController();
124
bool haveModifiedFiles();
126
QGuardedPtr<VariableWidget> variableWidget;
127
QGuardedPtr<GDBBreakpointWidget> gdbBreakpointWidget;
128
QGuardedPtr<FramestackWidget> framestackWidget;
129
QGuardedPtr<DisassembleWidget> disassembleWidget;
130
QGuardedPtr<GDBOutputWidget> gdbOutputWidget;
131
QGuardedPtr<ViewerWidget> viewerWidget;
132
GDBController *controller;
133
QGuardedPtr<QLabel> statusBarIndicator;
134
QGuardedPtr<DbgToolBar> floatingToolBar;
135
ProcessLineMaker* procLineMaker;
136
ProcessLineMaker* gdbLineMaker;
138
QString m_contextIdent;
141
KDevDebugger *m_debugger;
142
int previousDebuggerState_;
143
// Set to true after each debugger restart
144
// Currently used to auto-show variables view
145
// on the first pause.
148
// Flag that specifies in project rebuild is necessary
149
// before running the debugger. Set to 'true' in constructor
150
// because we have no idea if project is 'dirty' or not
151
// when it's opened, and then set to 'true' each time a file is
155
// Set by 'startDebugger' and cleared by 'slotStopDebugger'.