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.
12 #include <ksharedconfig.h>
13 #include <kxmlguiwindow.h>
19 class KAnimatedButton
;
20 class KRecentFilesAction
;
21 class KSqueezedTextLabel
;
25 class BreakpointTable
;
34 class DebuggerMainWnd
: public KXmlGuiWindow
41 bool debugProgram(const QString
& exe
, const QString
& lang
);
44 * Specifies the file where to write the transcript.
46 void setTranscript(const QString
& name
);
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
);
59 virtual void saveProperties(KConfigGroup
& cg
);
60 virtual void readProperties(const KConfigGroup
& cg
);
62 void saveSettings(KSharedConfigPtr
);
63 void restoreSettings(KSharedConfigPtr
);
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
;
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
;
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 */
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
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
);
144 QString m_outputTermCmdStr
;
145 QString m_outputTermKeepScript
;
146 QProcess
* m_outputTermProc
;
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 void makeDefaultLayout();
163 QString
makeSourceFilter();
165 // to avoid flicker when the status bar is updated,
166 // we store the last string that we put there
167 QPointer
<KAnimatedButton
> m_animation
;
168 QString m_lastActiveStatusText
;
172 KSqueezedTextLabel
* m_statusActiveLabel
;
173 QString m_statusActive
;
174 KSqueezedTextLabel
* m_statusMsgLabel
;
177 void setTabWidth(int tabWidth
);
180 virtual void updateUI();
181 virtual void updateLineItems();
183 void slotAddWatch(const QString
& text
);
184 void slotNewFileLoaded();
185 void slotNewStatusMsg();
186 void slotDebuggerStarting();
187 void slotToggleBreak(const QString
&, int, const DbgAddr
&, bool);
188 void slotEnaDisBreak(const QString
&, int, const DbgAddr
&);
189 void slotProgramStopped();
190 void slotBackTimer();
191 void slotRecentExec(const QUrl
& url
);
192 void slotLocalsPopup(const QPoint
& pt
);
193 void slotLocalsToWatch();
194 void slotEditValue();
199 void slotFileGlobalSettings();
200 void slotFileProgSettings();
201 void slotViewStatusbar();
202 void slotExecUntil();
203 void slotExecAttach();
205 void intoBackground();
206 void slotConfigureKeys();
209 #endif // DBGMAINWND_H