3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
11 #include <qpushbutton.h>
14 #include "sys/types.h" /* pid_t */
16 // forward declarations
25 class WatchWindow
: public QWidget
29 WatchWindow(QWidget
* parent
, const char* name
, WFlags f
= 0);
31 ExprWnd
* watchVariables() { return &m_watchVariables
; }
32 QString
watchText() const { return m_watchEdit
.text(); }
35 QLineEdit m_watchEdit
;
36 QPushButton m_watchAdd
;
37 QPushButton m_watchDelete
;
38 ExprWnd m_watchVariables
;
42 virtual bool eventFilter(QObject
* ob
, QEvent
* ev
);
49 void slotWatchHighlighted(int);
53 class DebuggerMainWndBase
56 DebuggerMainWndBase();
57 virtual ~DebuggerMainWndBase();
60 * Sets the command to invoke the terminal that displays the program
61 * output. If cmd is the empty string, the default is substituted.
63 void setTerminalCmd(const QString
& cmd
);
65 * Sets the command to invoke the debugger.
67 void setDebuggerCmdStr(const QString
& cmd
);
69 * Specifies the file where to write the transcript.
71 void setTranscript(const char* name
);
73 * Starts to debug the specified program using the specified language
76 bool debugProgram(const QString
& executable
, QCString lang
, QWidget
* parent
);
78 * Specifies the process to attach to after the program is loaded.
80 void setAttachPid(const QString
& pid
);
82 // the following are needed to handle program arguments
83 void setCoreFile(const QString
& corefile
);
84 void setRemoteDevice(const QString
&remoteDevice
);
85 /** helper around KFileDialog */
86 static QString
myGetFileName(QString caption
,
87 QString dir
, QString filter
,
89 /** invokes the global options dialog */
90 virtual void doGlobalOptions(QWidget
* parent
);
94 virtual void saveSettings(KConfig
*);
95 virtual void restoreSettings(KConfig
*);
97 // override must return the integrated output window
98 virtual TTYWindow
* ttyWindow() = 0;
101 QString m_statusActive
;
104 QString m_outputTermCmdStr
;
105 QString m_outputTermKeepScript
;
106 KProcess
* m_outputTermProc
;
108 virtual QString
createOutputWindow(); /* returns terminal name */
109 void shutdownTermWindow();
111 QString m_lastDirectory
; /* the dir of the most recently opened file */
113 QString m_transcriptFile
; /* where gdb dialog is logged */
115 bool m_popForeground
; /* whether main wnd raises when prog stops */
116 int m_backTimeout
; /* when wnd goes back */
117 int m_tabWidth
; /* tab width in characters (can be 0) */
118 QString m_sourceFilter
;
119 QString m_headerFilter
;
121 // the debugger proper
122 QString m_debuggerCmdStr
;
123 KDebugger
* m_debugger
;
124 void setupDebugger(QWidget
* parent
,
127 QListBox
* backtrace
);
128 DebuggerDriver
* driverFromLang(QCString lang
);
130 * This function derives a driver name from the contents of the named
133 QCString
driverNameFromFile(const QString
& exe
);
137 * Important! The following functions must be overridden in derived
138 * classes and be declared as slots! Note: These must not be declared
139 * virtual here since Qt signal mechanism fails miserably (because this
140 * class will not be the left-most base class!).
142 void newStatusMsg(KStatusBar
* statusbar
);
143 void slotDebuggerStarting();
146 #endif // MAINWNDBASE_H