~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/debugger/debuggerpart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 1999-2001 by John Birch                                 *
3
 
 *   jbb@kdevelop.org                                                      *
4
 
 *   Copyright (C) 2001 by Bernd Gehrmann                                  *
5
 
 *   bernd@kdevelop.org                                                    *
6
 
 *                                                                         *
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.                                   *
11
 
 *                                                                         *
12
 
 ***************************************************************************/
13
 
 
14
 
#ifndef _DEBUGGERPART_H_
15
 
#define _DEBUGGERPART_H_
16
 
 
17
 
#include <qguardedptr.h>
18
 
#include "kdevplugin.h"
19
 
#include "kdevcore.h"
20
 
 
21
 
#include "gdbcontroller.h"
22
 
#include "debuggerdcopinterface.h"
23
 
 
24
 
namespace KParts { class Part; }
25
 
 
26
 
class QLabel;
27
 
class QPopupMenu;
28
 
class KDialogBase;
29
 
class ProcessWidget;
30
 
class ProcessLineMaker;
31
 
class KDevAppFrontend;
32
 
class KDevDebugger;
33
 
 
34
 
namespace GDBDebugger
35
 
{
36
 
 
37
 
class GDBBreakpointWidget;
38
 
class FramestackWidget;
39
 
class DisassembleWidget;
40
 
class Breakpoint;
41
 
class GDBController;
42
 
class DbgToolBar;
43
 
class VariableWidget;
44
 
class GDBOutputWidget;
45
 
class ViewerWidget;
46
 
 
47
 
class DebuggerPart : public KDevPlugin, virtual public DebuggerDCOPInterface
48
 
{
49
 
    Q_OBJECT
50
 
 
51
 
public:
52
 
    DebuggerPart( QObject *parent, const char *name, const QStringList & );
53
 
    ~DebuggerPart();
54
 
    virtual void restorePartialProjectSession(const QDomElement* el);
55
 
    virtual void savePartialProjectSession(QDomElement* el);
56
 
 
57
 
k_dcop:
58
 
    virtual ASYNC slotDebugExternalProcess();
59
 
    virtual ASYNC slotDebugCommandLine(const QString& command);
60
 
 
61
 
private slots:
62
 
    void setupDcop();
63
 
    void guiClientAdded(KXMLGUIClient*);
64
 
    void contextMenu(QPopupMenu *popup, const Context *context);
65
 
    void toggleBreakpoint();
66
 
    void contextEvaluate();
67
 
    void contextWatch();
68
 
//    void projectOpened();
69
 
    void projectClosed();
70
 
    void projectConfigWidget(KDialogBase *dlg);
71
 
    void slotActivePartChanged(KParts::Part*);
72
 
 
73
 
    void slotRun();
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
78
 
    // is rebuilt.
79
 
    void slotRun_part2();
80
 
    void slotRestart();
81
 
    void slotExamineCore();
82
 
    void slotAttachProcess();
83
 
    void slotStopDebugger();
84
 
    void slotStop(KDevPlugin* which = 0);
85
 
    void slotPause();
86
 
    void slotRunToCursor();
87
 
    void slotJumpToCursor();
88
 
    void slotStepOver();
89
 
    void slotStepOverInstruction();
90
 
    void slotStepIntoInstruction();
91
 
    void slotStepInto();
92
 
    void slotStepOut();
93
 
    void slotMemoryView();
94
 
 
95
 
    void slotRefreshBPState(const Breakpoint&);
96
 
 
97
 
    void slotStatus(const QString &msg, int state);
98
 
    void slotShowStep(const QString &fileName, int lineNum);
99
 
    void slotGotoSource(const QString &fileName, int lineNum);
100
 
 
101
 
    void slotDCOPApplicationRegistered(const QCString &appId);
102
 
    void slotCloseDrKonqi();
103
 
 
104
 
    // Hide or show the view that's the sender of this signal.
105
 
    void slotShowView(bool enabled);
106
 
 
107
 
    void slotDebuggerAbnormalExit();
108
 
 
109
 
    // Called when some file in the project was saved.
110
 
    // Sets 'needRebuild_' to true.
111
 
    void slotFileSaved();
112
 
 
113
 
    void slotProjectCompiled();
114
 
 
115
 
    void slotEvent(GDBController::event_t);
116
 
 
117
 
private:
118
 
    KDevAppFrontend *appFrontend();
119
 
    KDevDebugger *debugger();
120
 
    
121
 
    bool attachProcess(int pid);
122
 
    bool startDebugger();
123
 
    void setupController();
124
 
    bool haveModifiedFiles();
125
 
 
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;
137
 
 
138
 
    QString m_contextIdent;
139
 
    QCString m_drkonqi;
140
 
    
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.
146
 
    bool justRestarted_;
147
 
 
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
152
 
    // modified.    
153
 
    bool needRebuild_;
154
 
 
155
 
    // Set by 'startDebugger' and cleared by 'slotStopDebugger'.
156
 
    bool running_;
157
 
 
158
 
signals:
159
 
    void buildProject();
160
 
};
161
 
 
162
 
}
163
 
 
164
 
#endif