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.
11 #include <kxmlguiwindow.h>
16 class KAnimatedButton
;
17 class KRecentFilesAction
;
22 class BreakpointTable
;
31 class DebuggerMainWnd
: public KXmlGuiWindow
38 bool debugProgram(const QString
& exe
, const QString
& lang
);
41 * Specifies the file where to write the transcript.
43 void setTranscript(const QString
& name
);
45 * Specifies the process to attach to after the program is loaded.
47 void setAttachPid(const QString
& pid
);
49 // the following are needed to handle program arguments
50 void setCoreFile(const QString
& corefile
);
51 void setRemoteDevice(const QString
&remoteDevice
);
52 void overrideProgramArguments(const QString
& args
);
56 virtual void saveProperties(KConfigGroup
& cg
);
57 virtual void readProperties(const KConfigGroup
& cg
);
59 void saveSettings(KSharedConfigPtr
);
60 void restoreSettings(KSharedConfigPtr
);
67 WinStack
* m_filesWindow
;
68 QListWidget
* m_btWindow
;
69 ExprWnd
* m_localVariables
;
70 WatchWindow
* m_watches
;
71 RegisterView
* m_registers
;
72 BreakpointTable
* m_bpTable
;
73 TTYWindow
* m_ttyWindow
;
74 ThreadList
* m_threads
;
75 MemoryWindow
* m_memoryWindow
;
79 // recent execs in File menu
80 QAction
* m_closeAction
;
81 QAction
* m_reloadAction
;
82 QAction
* m_fileExecAction
;
83 KRecentFilesAction
* m_recentExecAction
;
84 QAction
* m_coreDumpAction
;
85 QAction
* m_settingsAction
;
86 QAction
* m_findAction
;
87 QAction
* m_btWindowAction
;
88 QAction
* m_localVariablesAction
;
89 QAction
* m_watchesAction
;
90 QAction
* m_registersAction
;
91 QAction
* m_bpTableAction
;
92 QAction
* m_ttyWindowAction
;
93 QAction
* m_threadsAction
;
94 QAction
* m_memoryWindowAction
;
96 QAction
* m_stepIntoAction
;
97 QAction
* m_stepOverAction
;
98 QAction
* m_stepOutAction
;
99 QAction
* m_toCursorAction
;
100 QAction
* m_stepIntoIAction
;
101 QAction
* m_stepOverIAction
;
102 QAction
* m_execMovePCAction
;
103 QAction
* m_breakAction
;
104 QAction
* m_killAction
;
105 QAction
* m_restartAction
;
106 QAction
* m_attachAction
;
107 QAction
* m_argumentsAction
;
108 QAction
* m_bpSetAction
;
109 QAction
* m_bpSetTempAction
;
110 QAction
* m_bpEnableAction
;
111 QAction
* m_editValueAction
;
112 QString m_lastDirectory
; /* the dir of the most recently opened file */
115 virtual bool queryClose();
116 QAction
* createAction(const QString
& text
, const char* icon
,
117 int shortcut
, const QObject
* receiver
,
118 const char* slot
, const char* name
);
119 QAction
* createAction(const QString
& text
,
120 int shortcut
, const QObject
* receiver
,
121 const char* slot
, const char* name
);
123 // the debugger proper
124 QString m_debuggerCmdStr
;
125 KDebugger
* m_debugger
;
126 QString m_transcriptFile
; /* where gdb dialog is logged */
129 * Starts to debug the specified program using the specified language
132 bool startDriver(const QString
& executable
, QString lang
);
133 DebuggerDriver
* driverFromLang(QString lang
);
135 * Derives a driver name from the contents of the named file.
137 QString
driverNameFromFile(const QString
& exe
);
140 QString m_outputTermCmdStr
;
141 QString m_outputTermKeepScript
;
142 QProcess
* m_outputTermProc
;
145 QString
createOutputWindow();
147 bool m_popForeground
; /* whether main wnd raises when prog stops */
148 int m_backTimeout
; /* when wnd goes back */
149 int m_tabWidth
; /* tab width in characters (can be 0) */
150 QString m_sourceFilter
;
151 QString m_headerFilter
;
152 void setTerminalCmd(const QString
& cmd
);
153 void setDebuggerCmdStr(const QString
& cmd
);
155 QDockWidget
* createDockWidget(const char* name
, const QString
& title
);
156 QDockWidget
* dockParent(QWidget
* w
);
157 bool isDockVisible(QWidget
* w
);
158 void makeDefaultLayout();
160 QString
makeSourceFilter();
162 // to avoid flicker when the status bar is updated,
163 // we store the last string that we put there
164 KAnimatedButton
* m_animation
;
165 QString m_lastActiveStatusText
;
169 QString m_statusActive
;
172 void setTabWidth(int tabWidth
);
175 virtual void updateUI();
176 virtual void updateLineItems();
178 void slotAddWatch(const QString
& text
);
179 void slotNewFileLoaded();
180 void slotNewStatusMsg();
181 void slotDebuggerStarting();
182 void slotToggleBreak(const QString
&, int, const DbgAddr
&, bool);
183 void slotEnaDisBreak(const QString
&, int, const DbgAddr
&);
184 void slotProgramStopped();
185 void slotBackTimer();
186 void slotRecentExec(const KUrl
& url
);
187 void slotLocalsPopup(const QPoint
& pt
);
188 void slotLocalsToWatch();
189 void slotEditValue();
194 void slotFileGlobalSettings();
195 void slotFileProgSettings();
196 void slotViewStatusbar();
197 void slotExecUntil();
198 void slotExecAttach();
200 void intoBackground();
201 void slotConfigureKeys();
204 #endif // DBGMAINWND_H