1
/***************************************************************************
3
copyright : (C) 1999 by John Birch
4
email : jbb@kdevelop.org
6
Adapted for ruby debugging
7
--------------------------
9
copyright : (C) 2004 by Richard Dale
10
email : Richard_Dale@tipitina.demon.co.uk
11
***************************************************************************/
13
/***************************************************************************
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. *
20
***************************************************************************/
22
#ifndef _DBGCONTROLLER_H_
23
#define _DBGCONTROLLER_H_
40
/***************************************************************************/
44
/***************************************************************************/
45
// sigh - namespace's don't work on some of the older compilers
48
s_dbgNotStarted = 1 << 0,
49
s_appNotStarted = 1 << 1,
51
s_waitForWrite = 1 << 3,
52
s_programExited = 1 << 4,
54
s_fetchLocals = 1 << 6,
58
s_fetchGlobals = 1 << 10,
59
s_waitTimer = 1 << 11,
60
s_shuttingDown = 1 << 12,
61
s_viewThreads = 1 << 13
66
RTTI_WATCH_ROOT = 1001,
67
RTTI_GLOBAL_ROOT = 1002,
68
RTTI_VAR_FRAME_ROOT = 1003,
69
RTTI_LAZY_FETCH_ITEM = 1004,
71
RTTI_WATCH_VAR_ITEM = 1006,
72
RTTI_THREAD_STACK_ITEM = 1007,
73
RTTI_FRAME_STACK_ITEM = 1008
77
/***************************************************************************/
78
/***************************************************************************/
79
/***************************************************************************/
80
class DbgController : public QObject
87
virtual ~DbgController();
89
virtual bool stateIsOn( int state ) = 0;
92
virtual void queueCmd(DbgCommand *cmd, bool executeNext) = 0;
93
virtual void parse(char *str) = 0;
96
virtual void configure() = 0;
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
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,
115
bool trace_into_ruby) = 0;
117
virtual void slotStopDebugger() = 0;
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;
125
virtual void slotBreakInto() = 0;
126
virtual void slotBPState(const Breakpoint&) = 0;
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;
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;
141
virtual void slotAcceptConnection(int passive_socket) = 0;
142
virtual void slotReadFromSocket(int socket) = 0;
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);
156
KProcess *dbgProcess_;