~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/ruby/debugger/dbgcontroller.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    begin                : Sun Aug 8 1999
3
 
    copyright            : (C) 1999 by John Birch
4
 
    email                : jbb@kdevelop.org
5
 
        
6
 
                          Adapted for ruby debugging
7
 
                          --------------------------
8
 
    begin                : Mon Nov 1 2004
9
 
    copyright            : (C) 2004 by Richard Dale
10
 
    email                : Richard_Dale@tipitina.demon.co.uk
11
 
 ***************************************************************************/
12
 
 
13
 
/***************************************************************************
14
 
 *                                                                         *
15
 
 *   This program is free software; you can redistribute it and/or modify  *
16
 
 *   it under the terms of the GNU General Public License as published by  *
17
 
 *   the Free Software Foundation; either version 2 of the License, or     *
18
 
 *   (at your option) any later version.                                   *
19
 
 *                                                                         *
20
 
 ***************************************************************************/
21
 
 
22
 
#ifndef _DBGCONTROLLER_H_
23
 
#define _DBGCONTROLLER_H_
24
 
 
25
 
#include <qobject.h>
26
 
#include <domutil.h>
27
 
 
28
 
class KProcess;
29
 
class QString;
30
 
class QStrList;
31
 
 
32
 
namespace RDBDebugger
33
 
{
34
 
 
35
 
class Breakpoint;
36
 
class DbgCommand;
37
 
class LazyFetchItem;
38
 
class VarItem;
39
 
 
40
 
/***************************************************************************/
41
 
/**
42
 
 * @author jbb
43
 
 */
44
 
/***************************************************************************/
45
 
// sigh - namespace's don't work on some of the older compilers
46
 
enum DBGStateFlags
47
 
{
48
 
  s_dbgNotStarted     = 1 << 0,
49
 
  s_appNotStarted     = 1 << 1,
50
 
  s_appBusy           = 1 << 2,
51
 
  s_waitForWrite      = 1 << 3,
52
 
  s_programExited     = 1 << 4,
53
 
  s_silent            = 1 << 5,
54
 
  s_fetchLocals       = 1 << 6,
55
 
  s_viewBT            = 1 << 7,
56
 
  s_viewBP            = 1 << 8,
57
 
  s_attached          = 1 << 9,
58
 
  s_fetchGlobals      = 1 << 10,
59
 
  s_waitTimer         = 1 << 11,
60
 
  s_shuttingDown      = 1 << 12,
61
 
  s_viewThreads       = 1 << 13
62
 
};
63
 
 
64
 
                                
65
 
enum RttiValues { 
66
 
        RTTI_WATCH_ROOT                 = 1001, 
67
 
        RTTI_GLOBAL_ROOT                = 1002, 
68
 
        RTTI_VAR_FRAME_ROOT             = 1003, 
69
 
        RTTI_LAZY_FETCH_ITEM    = 1004,
70
 
        RTTI_VAR_ITEM                   = 1005,
71
 
        RTTI_WATCH_VAR_ITEM             = 1006,
72
 
        RTTI_THREAD_STACK_ITEM  = 1007,
73
 
        RTTI_FRAME_STACK_ITEM   = 1008
74
 
}; 
75
 
 
76
 
 
77
 
/***************************************************************************/
78
 
/***************************************************************************/
79
 
/***************************************************************************/
80
 
class DbgController : public QObject
81
 
{
82
 
    Q_OBJECT
83
 
 
84
 
public:
85
 
 
86
 
    DbgController();
87
 
    virtual ~DbgController();
88
 
 
89
 
    virtual bool stateIsOn( int state )                                     = 0;
90
 
 
91
 
protected:
92
 
    virtual void queueCmd(DbgCommand *cmd, bool executeNext)                = 0;
93
 
    virtual void parse(char *str)                                           = 0;
94
 
 
95
 
public slots:
96
 
    virtual void configure()                                                = 0;
97
 
 
98
 
    /**
99
 
     * Start the debugger
100
 
     * \param ruby_interpreter shell
101
 
         * \param character_coding -K option
102
 
     * \param run_directory Directory from where the program should be run
103
 
     * \param debuggee_path Absolute path to debuggee.rb debugger script
104
 
     * \param application Absolute path to application
105
 
     * \param run_arguments Command line arguments to be passed to the application
106
 
     * \param show_constants Show ruby constants in the variables view
107
 
     */
108
 
    virtual void slotStart(const QString& ruby_interpreter,
109
 
                               const QString& character_coding,
110
 
                           const QString& run_directory,
111
 
                                                   const QString& debuggee_path,
112
 
                           const QString& application,
113
 
                           const QString& run_arguments,
114
 
                           bool show_constants,
115
 
                           bool trace_into_ruby)                            = 0;
116
 
 
117
 
    virtual void slotStopDebugger()                                         = 0;
118
 
 
119
 
    virtual void slotRun()                                                  = 0;
120
 
    virtual void slotRunUntil(const QString &fileName, int lineNum)         = 0;
121
 
    virtual void slotStepInto()                                             = 0;
122
 
    virtual void slotStepOver()                                             = 0;
123
 
    virtual void slotStepOutOff()                                           = 0;
124
 
 
125
 
    virtual void slotBreakInto()                                            = 0;
126
 
    virtual void slotBPState(const Breakpoint&)                             = 0;
127
 
 
128
 
 
129
 
    virtual void slotExpandItem(VarItem *parent,
130
 
                                    const QCString &userRequest)            = 0;
131
 
    virtual void slotSelectFrame(int frame, int thread, 
132
 
                                        const QString& frameName)               = 0;
133
 
    virtual void slotFetchGlobals(bool fetch)                               = 0;
134
 
 
135
 
protected slots:
136
 
    virtual void slotDbgStdout(KProcess *proc, char *buf, int buflen)       = 0;
137
 
    virtual void slotDbgStderr(KProcess*, char*, int) {} ;
138
 
    virtual void slotDbgWroteStdin(KProcess *proc)                          = 0;
139
 
    virtual void slotDbgProcessExited(KProcess *proc)                       = 0;
140
 
        
141
 
    virtual void slotAcceptConnection(int passive_socket)                   = 0;
142
 
    virtual void slotReadFromSocket(int socket)                             = 0;
143
 
 
144
 
signals:
145
 
    void gotoSourcePosition   (const QString &fileName, int lineNum);
146
 
    void rawRDBBreakpointList (char *buf);
147
 
    void rawRDBBreakpointSet  (char *buf, int key);
148
 
    void ttyStdout            (const char *output);
149
 
    void ttyStderr            (const char *output);
150
 
    void rdbStdout            (const char *output);
151
 
    void rdbStderr            (const char *output);
152
 
    void showStepInSource     (const QString &fileName, int lineNum, const QString &address);
153
 
    void dbgStatus            (const QString &status, int statusFlag);
154
 
 
155
 
protected:
156
 
    KProcess *dbgProcess_;
157
 
};
158
 
 
159
 
}
160
 
 
161
 
#endif