Generate and install scalable icons.
[kdbg.git] / kdbg / dbgmainwnd.h
blob6882c5f7b86741254775f9fbbc9a77b16ab896fa
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 <QPointer>
11 #include <QTimer>
12 #include <ksharedconfig.h>
13 #include <kxmlguiwindow.h>
14 #include "regwnd.h"
16 class QDockWidget;
17 class QProcess;
18 class QUrl;
19 class KAnimatedButton;
20 class KRecentFilesAction;
21 class KSqueezedTextLabel;
22 class WinStack;
23 class QListWidget;
24 class ExprWnd;
25 class BreakpointTable;
26 class ThreadList;
27 class MemoryWindow;
28 class TTYWindow;
29 class WatchWindow;
30 class KDebugger;
31 class DebuggerDriver;
32 struct DbgAddr;
34 class DebuggerMainWnd : public KXmlGuiWindow
36 Q_OBJECT
37 public:
38 DebuggerMainWnd();
39 ~DebuggerMainWnd();
41 bool debugProgram(const QString& exe, const QString& lang);
43 /**
44 * Specifies the file where to write the transcript.
46 void setTranscript(const QString& name);
47 /**
48 * Specifies the process to attach to after the program is loaded.
50 void setAttachPid(const QString& pid);
52 // the following are needed to handle program arguments
53 void setCoreFile(const QString& corefile);
54 void setRemoteDevice(const QString &remoteDevice);
55 void overrideProgramArguments(const QString& args);
57 protected:
58 // session properties
59 virtual void saveProperties(KConfigGroup& cg);
60 virtual void readProperties(const KConfigGroup& cg);
61 // settings
62 void saveSettings(KSharedConfigPtr);
63 void restoreSettings(KSharedConfigPtr);
65 void initAnimation();
66 void initStatusBar();
67 void initKAction();
69 // view windows
70 WinStack* m_filesWindow;
71 QListWidget* m_btWindow;
72 ExprWnd* m_localVariables;
73 WatchWindow* m_watches;
74 RegisterView* m_registers;
75 BreakpointTable* m_bpTable;
76 TTYWindow* m_ttyWindow;
77 ThreadList* m_threads;
78 MemoryWindow* m_memoryWindow;
80 QTimer m_backTimer;
82 // recent execs in File menu
83 QAction* m_closeAction;
84 QAction* m_reloadAction;
85 QAction* m_fileExecAction;
86 KRecentFilesAction* m_recentExecAction;
87 QAction* m_coreDumpAction;
88 QAction* m_settingsAction;
89 QAction* m_findAction;
90 QAction* m_btWindowAction;
91 QAction* m_localVariablesAction;
92 QAction* m_watchesAction;
93 QAction* m_registersAction;
94 QAction* m_bpTableAction;
95 QAction* m_ttyWindowAction;
96 QAction* m_threadsAction;
97 QAction* m_memoryWindowAction;
98 QAction* m_runAction;
99 QAction* m_stepIntoAction;
100 QAction* m_stepOverAction;
101 QAction* m_stepOutAction;
102 QAction* m_toCursorAction;
103 QAction* m_stepIntoIAction;
104 QAction* m_stepOverIAction;
105 QAction* m_execMovePCAction;
106 QAction* m_breakAction;
107 QAction* m_killAction;
108 QAction* m_restartAction;
109 QAction* m_attachAction;
110 QAction* m_detachAction;
111 QAction* m_argumentsAction;
112 QAction* m_bpSetAction;
113 QAction* m_bpSetTempAction;
114 QAction* m_bpEnableAction;
115 QAction* m_editValueAction;
116 QString m_lastDirectory; /* the dir of the most recently opened file */
118 protected:
119 virtual bool queryClose();
120 QAction* createAction(const QString& text, const char* icon,
121 int shortcut, const QObject* receiver,
122 const char* slot, const char* name);
123 QAction* createAction(const QString& text,
124 int shortcut, const QObject* receiver,
125 const char* slot, const char* name);
127 // the debugger proper
128 QString m_debuggerCmdStr;
129 KDebugger* m_debugger;
130 QString m_transcriptFile; /* where gdb dialog is logged */
133 * Starts to debug the specified program using the specified language
134 * driver.
136 bool startDriver(const QString& executable, QString lang);
137 DebuggerDriver* driverFromLang(QString lang);
139 * Derives a driver name from the contents of the named file.
141 QString driverNameFromFile(const QString& exe);
143 // output window
144 QString m_outputTermCmdStr;
145 QString m_outputTermKeepScript;
146 QProcess* m_outputTermProc;
147 int m_ttyLevel;
149 QString createOutputWindow();
151 bool m_popForeground; /* whether main wnd raises when prog stops */
152 int m_backTimeout; /* when wnd goes back */
153 int m_tabWidth; /* tab width in characters (can be 0) */
154 QString m_sourceFilter;
155 QString m_headerFilter;
156 void setTerminalCmd(const QString& cmd);
157 void setDebuggerCmdStr(const QString& cmd);
159 QDockWidget* createDockWidget(const char* name, const QString& title);
160 QDockWidget* dockParent(QWidget* w);
161 bool isDockVisible(QWidget* w);
162 void makeDefaultLayout();
164 QString makeSourceFilter();
166 // to avoid flicker when the status bar is updated,
167 // we store the last string that we put there
168 QPointer<KAnimatedButton> m_animation;
169 QString m_lastActiveStatusText;
170 bool m_animRunning;
172 // statusbar texts
173 KSqueezedTextLabel* m_statusActiveLabel;
174 QString m_statusActive;
175 KSqueezedTextLabel* m_statusMsgLabel;
177 signals:
178 void setTabWidth(int tabWidth);
180 public slots:
181 virtual void updateUI();
182 virtual void updateLineItems();
183 void slotAddWatch();
184 void slotAddWatch(const QString& text);
185 void slotNewFileLoaded();
186 void slotNewStatusMsg();
187 void slotDebuggerStarting();
188 void slotToggleBreak(const QString&, int, const DbgAddr&, bool);
189 void slotEnaDisBreak(const QString&, int, const DbgAddr&);
190 void slotProgramStopped();
191 void slotBackTimer();
192 void slotRecentExec(const QUrl& url);
193 void slotLocalsPopup(const QPoint& pt);
194 void slotLocalsToWatch();
195 void slotEditValue();
197 void slotFileOpen();
198 void slotFileExe();
199 void slotFileCore();
200 void slotFileGlobalSettings();
201 void slotFileProgSettings();
202 void slotViewStatusbar();
203 void slotExecUntil();
204 void slotExecAttach();
205 void slotExecArgs();
206 void intoBackground();
207 void slotConfigureKeys();
210 #endif // DBGMAINWND_H