root/trunk/thune/debugger/ThuneDebugger.h

Revision 458, 2.3 kB (checked in by krobillard, 17 months ago)

Merged Thune thread_safe branch into trunk (r386:457)

Line 
1#ifndef THUNEDEBUGGER_H
2#define THUNEDEBUGGER_H
3/*==========================================================================*
4
5 *==========================================================================*/
6
7
8#include <QMainWindow>
9#include "env.h"
10
11
12class QAction;
13class QMenu;
14class QTextEdit;
15class QEventLoop;
16class StackDisplay;
17
18class ThuneDebugger : public QMainWindow
19{
20    Q_OBJECT
21
22public:
23
24    ThuneDebugger();
25    ~ThuneDebugger();
26
27protected:
28
29    void closeEvent(QCloseEvent *event);
30
31private slots:
32
33    void newFile();
34    void open();
35    bool save();
36    bool saveAs();
37    void openRecentFile();
38    void about();
39    void documentWasModified();
40
41    void dbRun();
42    void dbStep();
43    void dbHalt();
44
45private:
46
47    void createActions();
48    void createMenus();
49    void createToolBars();
50    void createStatusBar();
51    void readSettings();
52    void writeSettings();
53    bool maybeSave();
54    void loadFile(const QString &fileName);
55    bool saveFile(const QString &fileName);
56    void setCurrentFile(const QString &fileName);
57    void addRecentFile( const QString &fileName );
58    void updateRecentFileActions();
59    QString strippedName(const QString &fullFileName);
60
61    static int monitorIgnore( UThread*, int cmd, UCell* pc, UCell* end );
62    static int monitorRun   ( UThread*, int cmd, UCell* pc, UCell* end );
63    static int monitorStep  ( UThread*, int cmd, UCell* pc, UCell* end );
64
65    void showPC( UThread*, UCell* pc, UCell* end );
66    void setMode( int );
67    bool createEnv();
68    void destroyEnv();
69    void eval();
70
71    QTextEdit* _editor;
72    QTextEdit* _console;
73    StackDisplay* _stack;
74    QString curFile;
75
76    QToolBar* _fileToolBar;
77    QToolBar* _editToolBar;
78    QToolBar* _debugToolBar;
79    QAction* newAct;
80    QAction* openAct;
81    QAction* saveAct;
82    QAction* saveAsAct;
83    QAction* exitAct;
84    QAction* cutAct;
85    QAction* copyAct;
86    QAction* pasteAct;
87    QAction* aboutAct;
88    QAction* separatorAct;
89
90    QAction* _actRun;
91    QAction* _actStep;
92    QAction* _actHalt;
93
94    QEventLoop* _loop;
95    UrlanEnv _env;
96
97    enum
98    {
99        kModeVoid,
100        kModeRun,
101        kModeStep,
102        kModeDone
103    };
104    int  _mode;
105    int  _runCycle;
106    bool _interrupt;
107
108    enum { MaxRecentFiles = 4 };
109    QAction* recentFileActs[ MaxRecentFiles ];
110};
111
112
113#endif  //THUNEDEBUGGER_H
Note: See TracBrowser for help on using the browser.