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.
10 #include <qlineedit.h>
12 #include <qpushbutton.h>
15 #include "sys/types.h" /* pid_t */
17 // forward declarations
26 class WatchWindow
: public QWidget
30 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
32 ExprWnd
* watchVariables() { return &m_watchVariables
; }
33 QString
watchText() const { return m_watchEdit
.text(); }
34 int columnWidth(int i
) const { return m_watchVariables
.columnWidth(i
); }
35 void setColumnWidth(int i
, int w
) { m_watchVariables
.setColumnWidth(i
, w
); }
38 QLineEdit m_watchEdit
;
39 QPushButton m_watchAdd
;
40 QPushButton m_watchDelete
;
41 ExprWnd m_watchVariables
;
45 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
46 virtual void dragEnterEvent(QDragEnterEvent
* event
);
47 virtual void dropEvent(QDropEvent
* event
);
52 void textDropped(const QString
& text
);
55 void slotWatchHighlighted();
59 class DebuggerMainWndBase
62 DebuggerMainWndBase();
63 virtual ~DebuggerMainWndBase();
66 * Sets the command to invoke the terminal that displays the program
67 * output. If cmd is the empty string, the default is substituted.
69 void setTerminalCmd(const QString
& cmd
);
71 * Sets the command to invoke the debugger.
73 void setDebuggerCmdStr(const QString
& cmd
);
75 * Specifies the file where to write the transcript.
77 void setTranscript(const QString
& name
);
79 * Starts to debug the specified program using the specified language
82 bool debugProgram(const QString
& executable
, QString lang
, QWidget
* parent
);
84 * Specifies the process to attach to after the program is loaded.
86 void setAttachPid(const QString
& pid
);
88 // the following are needed to handle program arguments
89 void setCoreFile(const QString
& corefile
);
90 void setRemoteDevice(const QString
&remoteDevice
);
91 void overrideProgramArguments(const QString
& args
);
92 /** helper around KFileDialog */
93 static QString
myGetFileName(QString caption
,
94 QString dir
, QString filter
,
96 /** invokes the global options dialog */
97 virtual void doGlobalOptions(QWidget
* parent
);
101 virtual void saveSettings(KConfig
*);
102 virtual void restoreSettings(KConfig
*);
104 // override must return the integrated output window
105 virtual TTYWindow
* ttyWindow() = 0;
108 QString m_statusActive
;
111 QString m_outputTermCmdStr
;
112 QString m_outputTermKeepScript
;
113 KProcess
* m_outputTermProc
;
115 virtual QString
createOutputWindow(); /* returns terminal name */
116 void shutdownTermWindow();
118 QString m_lastDirectory
; /* the dir of the most recently opened file */
120 QString m_transcriptFile
; /* where gdb dialog is logged */
122 bool m_popForeground
; /* whether main wnd raises when prog stops */
123 int m_backTimeout
; /* when wnd goes back */
124 int m_tabWidth
; /* tab width in characters (can be 0) */
125 QString m_sourceFilter
;
126 QString m_headerFilter
;
128 // the debugger proper
129 QString m_debuggerCmdStr
;
130 KDebugger
* m_debugger
;
131 void setupDebugger(QWidget
* parent
,
134 QListBox
* backtrace
);
135 DebuggerDriver
* driverFromLang(QString lang
);
137 * This function derives a driver name from the contents of the named
140 QString
driverNameFromFile(const QString
& exe
);
144 * Important! The following functions must be overridden in derived
145 * classes and be declared as slots! Note: These must not be declared
146 * virtual here since Qt signal mechanism fails miserably (because this
147 * class will not be the left-most base class!).
149 void newStatusMsg(KStatusBar
* statusbar
);
150 void slotDebuggerStarting();
153 #endif // MAINWNDBASE_H