Convert from Qt 3 to Qt 4 using qt3to4.
[kdbg.git] / kdbg / dbgmainwnd.h
blobd9e1e7cebedce370488bc6c3c398fbae678f8b13
1 /*
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.
5 */
7 #ifndef DBGMAINWND_H
8 #define DBGMAINWND_H
10 #include <qtimer.h>
11 #include <q3dockwindow.h>
12 #include <Q3CString>
13 #include <kmainwindow.h>
14 #include "regwnd.h"
16 typedef Q3DockWindow QDockWidget;
17 class KProcess;
18 class KRecentFilesAction;
19 class KToggleAction;
20 class WinStack;
21 class Q3ListBox;
22 class Q3CString;
23 class ExprWnd;
24 class BreakpointTable;
25 class ThreadList;
26 class MemoryWindow;
27 class TTYWindow;
28 class WatchWindow;
29 class KDebugger;
30 class DebuggerDriver;
31 struct DbgAddr;
33 class DebuggerMainWnd : public KMainWindow
35 Q_OBJECT
36 public:
37 DebuggerMainWnd(const char* name);
38 ~DebuggerMainWnd();
40 bool debugProgram(const QString& exe, const QString& lang);
42 /**
43 * Specifies the file where to write the transcript.
45 void setTranscript(const QString& name);
46 /**
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);
56 protected:
57 // session properties
58 virtual void saveProperties(KConfig*);
59 virtual void readProperties(KConfig*);
60 // settings
61 void saveSettings(KConfig*);
62 void restoreSettings(KConfig*);
64 void initToolbar();
65 void initKAction();
67 // view windows
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;
78 QTimer m_backTimer;
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;
96 KAction* m_runAction;
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 */
115 protected:
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
131 * driver.
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);
140 // output window
141 QString m_outputTermCmdStr;
142 QString m_outputTermKeepScript;
143 KProcess* m_outputTermProc;
144 int m_ttyLevel;
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;
166 bool m_animRunning;
168 // statusbar texts
169 QString m_statusActive;
171 signals:
172 void setTabWidth(int tabWidth);
174 public slots:
175 virtual void updateUI();
176 virtual void updateLineItems();
177 void slotAddWatch();
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();
192 void slotFileOpen();
193 void slotFileExe();
194 void slotFileCore();
195 void slotFileGlobalSettings();
196 void slotFileProgSettings();
197 void slotViewStatusbar();
198 void slotExecUntil();
199 void slotExecAttach();
200 void slotExecArgs();
201 void intoBackground();
202 void slotConfigureKeys();
205 #endif // DBGMAINWND_H