2 * Copyright Johannes Sixt
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
12 #include <kxmlguiwindow.h>
17 class KAnimatedButton
;
18 class KRecentFilesAction
;
19 class KSqueezedTextLabel
;
24 class BreakpointTable
;
33 class DebuggerMainWnd
: public KXmlGuiWindow
40 bool debugProgram(const QString
& exe
, const QString
& lang
);
43 * Specifies the file where to write the transcript.
45 void setTranscript(const QString
& name
);
47 * Specifies the process to attach to after the program is loaded.
49 void setAttachPid(const QString
& pid
);
51 // the following are needed to handle program arguments
52 void setCoreFile(const QString
& corefile
);
53 void setRemoteDevice(const QString
&remoteDevice
);
54 void overrideProgramArguments(const QString
& args
);
58 virtual void saveProperties(KConfigGroup
& cg
);
59 virtual void readProperties(const KConfigGroup
& cg
);
61 void saveSettings(KSharedConfigPtr
);
62 void restoreSettings(KSharedConfigPtr
);
69 WinStack
* m_filesWindow
;
70 QListWidget
* m_btWindow
;
71 ExprWnd
* m_localVariables
;
72 WatchWindow
* m_watches
;
73 RegisterView
* m_registers
;
74 BreakpointTable
* m_bpTable
;
75 TTYWindow
* m_ttyWindow
;
76 ThreadList
* m_threads
;
77 MemoryWindow
* m_memoryWindow
;
81 // recent execs in File menu
82 QAction
* m_closeAction
;
83 QAction
* m_reloadAction
;
84 QAction
* m_fileExecAction
;
85 KRecentFilesAction
* m_recentExecAction
;
86 QAction
* m_coreDumpAction
;
87 QAction
* m_settingsAction
;
88 QAction
* m_findAction
;
89 QAction
* m_btWindowAction
;
90 QAction
* m_localVariablesAction
;
91 QAction
* m_watchesAction
;
92 QAction
* m_registersAction
;
93 QAction
* m_bpTableAction
;
94 QAction
* m_ttyWindowAction
;
95 QAction
* m_threadsAction
;
96 QAction
* m_memoryWindowAction
;
98 QAction
* m_stepIntoAction
;
99 QAction
* m_stepOverAction
;
100 QAction
* m_stepOutAction
;
101 QAction
* m_toCursorAction
;
102 QAction
* m_stepIntoIAction
;
103 QAction
* m_stepOverIAction
;
104 QAction
* m_execMovePCAction
;
105 QAction
* m_breakAction
;
106 QAction
* m_killAction
;
107 QAction
* m_restartAction
;
108 QAction
* m_attachAction
;
109 QAction
* m_detachAction
;
110 QAction
* m_argumentsAction
;
111 QAction
* m_bpSetAction
;
112 QAction
* m_bpSetTempAction
;
113 QAction
* m_bpEnableAction
;
114 QAction
* m_editValueAction
;
115 QString m_lastDirectory
; /* the dir of the most recently opened file */
118 virtual bool queryClose();
119 QAction
* createAction(const QString
& text
, const char* icon
,
120 int shortcut
, const QObject
* receiver
,
121 const char* slot
, const char* name
);
122 QAction
* createAction(const QString
& text
,
123 int shortcut
, const QObject
* receiver
,
124 const char* slot
, const char* name
);
126 // the debugger proper
127 QString m_debuggerCmdStr
;
128 KDebugger
* m_debugger
;
129 QString m_transcriptFile
; /* where gdb dialog is logged */
132 * Starts to debug the specified program using the specified language
135 bool startDriver(const QString
& executable
, QString lang
);
136 DebuggerDriver
* driverFromLang(QString lang
);
138 * Derives a driver name from the contents of the named file.
140 QString
driverNameFromFile(const QString
& exe
);
143 QString m_outputTermCmdStr
;
144 QString m_outputTermKeepScript
;
145 QProcess
* m_outputTermProc
;
148 QString
createOutputWindow();
150 bool m_popForeground
; /* whether main wnd raises when prog stops */
151 int m_backTimeout
; /* when wnd goes back */
152 int m_tabWidth
; /* tab width in characters (can be 0) */
153 QString m_sourceFilter
;
154 QString m_headerFilter
;
155 void setTerminalCmd(const QString
& cmd
);
156 void setDebuggerCmdStr(const QString
& cmd
);
158 QDockWidget
* createDockWidget(const char* name
, const QString
& title
);
159 QDockWidget
* dockParent(QWidget
* w
);
160 bool isDockVisible(QWidget
* w
);
161 void makeDefaultLayout();
163 QString
makeSourceFilter();
165 // to avoid flicker when the status bar is updated,
166 // we store the last string that we put there
167 QPointer
<KAnimatedButton
> m_animation
;
168 QString m_lastActiveStatusText
;
172 KSqueezedTextLabel
* m_statusActiveLabel
;
173 QString m_statusActive
;
174 KSqueezedTextLabel
* m_statusMsgLabel
;
177 void setTabWidth(int tabWidth
);
180 virtual void updateUI();
181 virtual void updateLineItems();
183 void slotAddWatch(const QString
& text
);
184 void slotNewFileLoaded();
185 void slotNewStatusMsg();
186 void slotDebuggerStarting();
187 void slotToggleBreak(const QString
&, int, const DbgAddr
&, bool);
188 void slotEnaDisBreak(const QString
&, int, const DbgAddr
&);
189 void slotProgramStopped();
190 void slotBackTimer();
191 void slotRecentExec(const KUrl
& url
);
192 void slotLocalsPopup(const QPoint
& pt
);
193 void slotLocalsToWatch();
194 void slotEditValue();
199 void slotFileGlobalSettings();
200 void slotFileProgSettings();
201 void slotViewStatusbar();
202 void slotExecUntil();
203 void slotExecAttach();
205 void intoBackground();
206 void slotConfigureKeys();
209 #endif // DBGMAINWND_H