languages/java/debugger/jdbcontroller.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef _JDBCONTROLLER_H_
00019
#define _JDBCONTROLLER_H_
00020
00021
#include "dbgcontroller.h"
00022
#include <qobject.h>
00023
#include <qptrlist.h>
00024
#include <qdict.h>
00025
#include <qstringlist.h>
00026
00027
00028
class KProcess;
00029
class QString;
00030
00031
namespace JAVADebugger
00032 {
00033
00034
class Breakpoint;
00035
class DbgCommand;
00036
class FramestackWidget;
00037
class VarItem;
00038
class VariableTree;
00039
class STTY;
00040
00041 class JDBVarItem :
QObject {
00042 Q_OBJECT
00043
public:
00044
JDBVarItem();
00045
QString toString();
00046
00047 QString value;
00048 QString name;
00049 QPtrList<JDBVarItem> siblings;
00050
00051 };
00052
00053
00059 class JDBController :
public DbgController
00060 {
00061 Q_OBJECT
00062
00063
public:
00064
JDBController(
VariableTree *varTree,
FramestackWidget *frameStack,
QString projectDirectory,
QString mainProgram);
00065
~JDBController();
00066
void reConfig();
00067
00068
protected:
00069
void queueCmd(
DbgCommand *cmd,
bool executeNext=
false);
00070
00071
private:
00072
QString getFile(
QString className);
00073
void varUpdateDone();
00074
void parseBacktraceList (
char *buf);
00075
void parseLocals (
char *buf);
00076
void analyzeDump (
QString data);
00077
char*
parseLine (
char *buf);
00078
char*
parseInfo (
char *buf);
00079
char*
parseBacktrace (
char *buf);
00080
char*
parseLocalVars (
char *buf);
00081
char*
parseDump (
char *buf);
00082
void parseLocals();
00083
void parseFrameSelected (
char *buf);
00084
00085
char *
parse (
char *buf);
00086
00087
void pauseApp();
00088
void executeCmd ();
00089
void destroyCmds();
00090
void removeInfoRequests();
00091
void actOnProgramPause(
const QString &msg);
00092
void programNoApp(
const QString &msg,
bool msgBox);
00093
00094
void setBreakpoint(
const QCString &BPSetCmd,
int key);
00095
void clearBreakpoint(
const QCString &BPClearCmd);
00096
void modifyBreakpoint(
Breakpoint *BP);
00097
00098 void setStateOn(
int stateOn) {
state_ |= stateOn; }
00099 void setStateOff(
int stateOff) {
state_ &= ~stateOff; }
00100 bool stateIsOn(
int state) {
return state_ &state; }
00101
00102 QString classpath_;
00103 QString mainclass_;
00104 QString projectDirectory_;
00105 QString curLine;
00106 QString curMethod,
locals;
00107 QDict<JDBVarItem> localData;
00108 QStringList nameQueue;
00109 int s_command;
00110 int stackLineCount,
varLineCount;
00111 bool parsedThis;
00112
public slots:
00113
void slotStart(
const QString &application,
const QString &args,
const QString &sDbgShell=
QString());
00114
void slotCoreFile(
const QString &coreFile);
00115
void slotAttachTo(
int pid);
00116
00117
void slotRun();
00118
void slotRunUntil(
const QString &filename,
int lineNum);
00119
void slotStepInto();
00120
void slotStepOver();
00121
void slotStepIntoIns();
00122
void slotStepOverIns();
00123
void slotStepOutOff();
00124
00125
void slotBreakInto();
00126
void slotBPState(
Breakpoint *BP);
00127
void slotClearAllBreakpoints();
00128
00129
void slotDisassemble(
const QString &start,
const QString &end);
00130
void slotMemoryDump(
const QString &start,
const QString &amount);
00131
void slotRegisters();
00132
void slotLibraries();
00133
00134
void slotExpandItem(
VarItem *parent);
00135
void slotExpandUserItem(
VarItem *parent,
const QCString &userRequest);
00136
void slotSelectFrame(
int frame);
00137
void slotSetLocalViewState(
bool onOff);
00138
00139
protected slots:
00140
void slotDbgStdout(
KProcess *proc,
char *buf,
int buflen);
00141
void slotDbgStderr(
KProcess *proc,
char *buf,
int buflen);
00142
void slotDbgWroteStdin(
KProcess *proc);
00143
void slotDbgProcessExited(
KProcess *proc);
00144
void slotStepInSource(
const QString &fileName,
int lineNum);
00145
void slotDbgStatus(
const QString &status,
int state);
00146
void slotDebuggerStarted();
00147
00148
private slots:
00149
void slotAbortTimedEvent();
00150
00151 signals:
00152
void rawData (
const QString &rawData);
00153
void showStepInSource (
const QString &fileName,
int lineNum,
const QString &address);
00154
void rawJDBBreakpointList (
char *buf);
00155
void rawJDBBreakpointSet (
char *buf,
int key);
00156
void rawJDBDisassemble (
char *buf);
00157
void rawJDBMemoryDump (
char *buf);
00158
void rawJDBRegisters (
char *buf);
00159
void rawJDBLibraries (
char *buf);
00160
void ttyStdout (
const char *output);
00161
void ttyStderr (
const char *output);
00162
void dbgStatus (
const QString &status,
int statusFlag);
00163
void acceptPendingBPs ();
00164
void unableToSetBPNow (
int BPNo);
00165
void debuggerStarted ();
00166
00167
private:
00168 FramestackWidget*
frameStack_;
00169 VariableTree*
varTree_;
00170 int currentFrame_;
00171
00172 int state_;
00173 int jdbSizeofBuf_;
00174 int jdbOutputLen_;
00175 char*
jdbOutput_;
00176
00177 QPtrList<DbgCommand> cmdList_;
00178 DbgCommand*
currentCmd_;
00179
00180 STTY*
tty_;
00181 bool programHasExited_;
00182
00183
00184 bool config_breakOnLoadingLibrary_;
00185 bool config_forceBPSet_;
00186 bool config_displayStaticMembers_;
00187 bool config_dbgTerminal_;
00188 QString config_jdbPath_;
00189 };
00190
00191 }
00192
00193
#endif
This file is part of the documentation for KDevelop Version 3.0.4.