Update backtrace window from deprecated Q3ListBox widget to QListWidget.
[kdbg.git] / kdbg / dbgmainwnd.h
blob2af39a0fe1d789c478dd40a9ba654cf58acf0201
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 K3Process;
16 class KAnimatedButton;
17 class KRecentFilesAction;
18 class KUrl;
19 class WinStack;
20 class QListWidget;
21 class Q3ListViewItem;
22 class ExprWnd;
23 class BreakpointTable;
24 class ThreadList;
25 class MemoryWindow;
26 class TTYWindow;
27 class WatchWindow;
28 class KDebugger;
29 class DebuggerDriver;
30 struct DbgAddr;
32 class DebuggerMainWnd : public KXmlGuiWindow
34 Q_OBJECT
35 public:
36 DebuggerMainWnd();
37 ~DebuggerMainWnd();
39 bool debugProgram(const QString& exe, const QString& lang);
41 /**
42 * Specifies the file where to write the transcript.
44 void setTranscript(const QString& name);
45 /**
46 * Specifies the process to attach to after the program is loaded.
48 void setAttachPid(const QString& pid);
50 // the following are needed to handle program arguments
51 void setCoreFile(const QString& corefile);
52 void setRemoteDevice(const QString &remoteDevice);
53 void overrideProgramArguments(const QString& args);
55 protected:
56 // session properties
57 virtual void saveProperties(KConfigGroup& cg);
58 virtual void readProperties(const KConfigGroup& cg);
59 // settings
60 void saveSettings(KSharedConfigPtr);
61 void restoreSettings(KSharedConfigPtr);
63 void initToolbar();
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 K3Process* m_outputTermProc;
143 int m_ttyLevel;
145 QString createOutputWindow();
146 void shutdownTermWindow();
148 bool m_popForeground; /* whether main wnd raises when prog stops */
149 int m_backTimeout; /* when wnd goes back */
150 int m_tabWidth; /* tab width in characters (can be 0) */
151 QString m_sourceFilter;
152 QString m_headerFilter;
153 void setTerminalCmd(const QString& cmd);
154 void setDebuggerCmdStr(const QString& cmd);
156 QDockWidget* createDockWidget(const char* name, const QString& title);
157 QDockWidget* dockParent(QWidget* w);
158 bool isDockVisible(QWidget* w);
159 void makeDefaultLayout();
161 QString makeSourceFilter();
163 // to avoid flicker when the status bar is updated,
164 // we store the last string that we put there
165 KAnimatedButton* m_animation;
166 QString m_lastActiveStatusText;
167 bool m_animRunning;
169 // statusbar texts
170 QString m_statusActive;
172 signals:
173 void setTabWidth(int tabWidth);
175 public slots:
176 virtual void updateUI();
177 virtual void updateLineItems();
178 void slotAddWatch();
179 void slotAddWatch(const QString& text);
180 void slotNewFileLoaded();
181 void slotNewStatusMsg();
182 void slotDebuggerStarting();
183 void slotToggleBreak(const QString&, int, const DbgAddr&, bool);
184 void slotEnaDisBreak(const QString&, int, const DbgAddr&);
185 void slotTermEmuExited();
186 void slotProgramStopped();
187 void slotBackTimer();
188 void slotRecentExec(const KUrl& url);
189 void slotLocalsPopup(Q3ListViewItem*, const QPoint& pt);
190 void slotLocalsToWatch();
191 void slotEditValue();
193 void slotFileOpen();
194 void slotFileExe();
195 void slotFileCore();
196 void slotFileGlobalSettings();
197 void slotFileProgSettings();
198 void slotViewStatusbar();
199 void slotExecUntil();
200 void slotExecAttach();
201 void slotExecArgs();
202 void intoBackground();
203 void slotConfigureKeys();
206 #endif // DBGMAINWND_H