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 <q3dockwindow.h>
13 #include <kmainwindow.h>
16 typedef Q3DockWindow QDockWidget
;
18 class KRecentFilesAction
;
24 class BreakpointTable
;
33 class DebuggerMainWnd
: public KMainWindow
37 DebuggerMainWnd(const char* name
);
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(KConfig
*);
59 virtual void readProperties(KConfig
*);
61 void saveSettings(KConfig
*);
62 void restoreSettings(KConfig
*);
68 WinStack
* m_filesWindow
;
69 Q3ListBox
* m_btWindow
;
70 ExprWnd
* m_localVariables
;
71 WatchWindow
* m_watches
;
72 RegisterView
* m_registers
;
73 BreakpointTable
* m_bpTable
;
74 TTYWindow
* m_ttyWindow
;
75 ThreadList
* m_threads
;
76 MemoryWindow
* m_memoryWindow
;
80 // recent execs in File menu
81 KAction
* m_closeAction
;
82 KAction
* m_reloadAction
;
83 KAction
* m_fileExecAction
;
84 KRecentFilesAction
* m_recentExecAction
;
85 KAction
* m_coreDumpAction
;
86 KAction
* m_settingsAction
;
87 KToggleAction
* m_findAction
;
88 KToggleAction
* m_btWindowAction
;
89 KToggleAction
* m_localVariablesAction
;
90 KToggleAction
* m_watchesAction
;
91 KToggleAction
* m_registersAction
;
92 KToggleAction
* m_bpTableAction
;
93 KToggleAction
* m_ttyWindowAction
;
94 KToggleAction
* m_threadsAction
;
95 KToggleAction
* m_memoryWindowAction
;
97 KAction
* m_stepIntoAction
;
98 KAction
* m_stepOverAction
;
99 KAction
* m_stepOutAction
;
100 KAction
* m_toCursorAction
;
101 KAction
* m_stepIntoIAction
;
102 KAction
* m_stepOverIAction
;
103 KAction
* m_execMovePCAction
;
104 KAction
* m_breakAction
;
105 KAction
* m_killAction
;
106 KAction
* m_restartAction
;
107 KAction
* m_attachAction
;
108 KAction
* m_argumentsAction
;
109 KAction
* m_bpSetAction
;
110 KAction
* m_bpSetTempAction
;
111 KAction
* m_bpEnableAction
;
112 KAction
* m_editValueAction
;
113 QString m_lastDirectory
; /* the dir of the most recently opened file */
116 virtual bool queryClose();
117 KAction
* createAction(const QString
& text
, const char* icon
,
118 int shortcut
, const QObject
* receiver
,
119 const char* slot
, const char* name
);
120 KAction
* createAction(const QString
& text
,
121 int shortcut
, const QObject
* receiver
,
122 const char* slot
, const char* name
);
124 // the debugger proper
125 QString m_debuggerCmdStr
;
126 KDebugger
* m_debugger
;
127 QString m_transcriptFile
; /* where gdb dialog is logged */
130 * Starts to debug the specified program using the specified language
133 bool startDriver(const QString
& executable
, QString lang
);
134 DebuggerDriver
* driverFromLang(QString lang
);
136 * Derives a driver name from the contents of the named file.
138 QString
driverNameFromFile(const QString
& exe
);
141 QString m_outputTermCmdStr
;
142 QString m_outputTermKeepScript
;
143 KProcess
* m_outputTermProc
;
146 QString
createOutputWindow();
147 void shutdownTermWindow();
149 bool m_popForeground
; /* whether main wnd raises when prog stops */
150 int m_backTimeout
; /* when wnd goes back */
151 int m_tabWidth
; /* tab width in characters (can be 0) */
152 QString m_sourceFilter
;
153 QString m_headerFilter
;
154 void setTerminalCmd(const QString
& cmd
);
155 void setDebuggerCmdStr(const QString
& cmd
);
157 QDockWidget
* createDockWidget(const char* name
, const QString
& title
);
158 QDockWidget
* dockParent(QWidget
* w
);
159 bool isDockVisible(QWidget
* w
);
161 QString
makeSourceFilter();
163 // to avoid flicker when the status bar is updated,
164 // we store the last string that we put there
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 slotTermEmuExited();
185 void slotProgramStopped();
186 void slotBackTimer();
187 void slotRecentExec(const KURL
& url
);
188 void slotLocalsPopup(Q3ListViewItem
*, const QPoint
& pt
);
189 void slotLocalsToWatch();
190 void slotEditValue();
195 void slotFileGlobalSettings();
196 void slotFileProgSettings();
197 void slotViewStatusbar();
198 void slotExecUntil();
199 void slotExecAttach();
201 void intoBackground();
202 void slotConfigureKeys();
205 #endif // DBGMAINWND_H