Add tooltips test program.
[kdbg.git] / kdbg / dbgmainwnd.h
blobe3610011e2d16464967beb3481af889acdeb825a
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>
11 #include <kxmlguiwindow.h>
12 #include "regwnd.h"
14 class QDockWidget;
15 class QProcess;
16 class KAnimatedButton;
17 class KRecentFilesAction;
18 class KUrl;
19 class WinStack;
20 class QListWidget;
21 class ExprWnd;
22 class BreakpointTable;
23 class ThreadList;
24 class MemoryWindow;
25 class TTYWindow;
26 class WatchWindow;
27 class KDebugger;
28 class DebuggerDriver;
29 struct DbgAddr;
31 class DebuggerMainWnd : public KXmlGuiWindow
33 Q_OBJECT
34 public:
35 DebuggerMainWnd();
36 ~DebuggerMainWnd();
38 bool debugProgram(const QString& exe, const QString& lang);
40 /**
41 * Specifies the file where to write the transcript.
43 void setTranscript(const QString& name);
44 /**
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);
54 protected:
55 // session properties
56 virtual void saveProperties(KConfigGroup& cg);
57 virtual void readProperties(const KConfigGroup& cg);
58 // settings
59 void saveSettings(KSharedConfigPtr);
60 void restoreSettings(KSharedConfigPtr);
62 void initAnimation();
63 void initStatusBar();
64 void initKAction();
66 // view windows
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;
77 QTimer m_backTimer;
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;
95 QAction* m_runAction;
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 */
114 protected:
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
130 * driver.
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);
139 // output window
140 QString m_outputTermCmdStr;
141 QString m_outputTermKeepScript;
142 QProcess* m_outputTermProc;
143 int m_ttyLevel;
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;
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 slotProgramStopped();
185 void slotBackTimer();
186 void slotRecentExec(const KUrl& url);
187 void slotLocalsPopup(const QPoint& pt);
188 void slotLocalsToWatch();
189 void slotEditValue();
191 void slotFileOpen();
192 void slotFileExe();
193 void slotFileCore();
194 void slotFileGlobalSettings();
195 void slotFileProgSettings();
196 void slotViewStatusbar();
197 void slotExecUntil();
198 void slotExecAttach();
199 void slotExecArgs();
200 void intoBackground();
201 void slotConfigureKeys();
204 #endif // DBGMAINWND_H