gdbcontroller.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 _GDBCONTROLLER_H_
00019 #define _GDBCONTROLLER_H_
00020
00021 #include "dbgcontroller.h"
00022
00023 #include <qcstring.h>
00024 #include <qdom.h>
00025 #include <qobject.h>
00026 #include <qptrlist.h>
00027 #include <qstring.h>
00028
00029 class KProcess;
00030
00031 namespace GDBDebugger
00032 {
00033
00034 class Breakpoint;
00035 class DbgCommand;
00036 class FramestackWidget;
00037 class VarItem;
00038 class VariableTree;
00039 class STTY;
00040
00046 class GDBController : public DbgController
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 GDBController(VariableTree *varTree, FramestackWidget *frameStack, QDomDocument &projectDom);
00052 ~GDBController();
00053
00054 protected:
00055 void queueCmd(DbgCommand *cmd, bool executeNext=false);
00056
00057 private:
00058 void parseProgramLocation (char *buf);
00059 void parseBacktraceList (char *buf);
00060 void parseThreadList (char* buf);
00061 void parseBreakpointSet (char *buf);
00062 void parseLocals (char type, char *buf);
00063 void parseRequestedData (char *buf);
00064 void parseWhatis (char *buf);
00065 void parseLine (char *buf);
00066 void parseFrameSelected (char *buf);
00067
00068
00069 char *parse (char *buf);
00070 char *parseOther (char *buf);
00071 char *parseCmdBlock (char *buf);
00072
00073 void pauseApp();
00074 void executeCmd ();
00075 void destroyCmds();
00076 void removeInfoRequests();
00077 void actOnProgramPause(const QString &msg);
00078 void programNoApp(const QString &msg, bool msgBox);
00079
00080 void setBreakpoint(const QCString &BPSetCmd, int key);
00081 void clearBreakpoint(const QCString &BPClearCmd);
00082 void modifyBreakpoint(const Breakpoint&);
00083
00084 void setStateOn(int stateOn) { state_ |= stateOn; }
00085 void setStateOff(int stateOff) { state_ &= ~stateOff; }
00086 bool stateIsOn(int state) { return state_ &state; }
00087
00088 public slots:
00089 void configure();
00090
00091 void slotStart(const QString& shell, const DomUtil::PairList& run_envvars, const QString& run_directory, const QString &application, const QString& run_arguments);
00092
00093 void slotCoreFile(const QString &coreFile);
00094 void slotAttachTo(int pid);
00095
00096 void slotStopDebugger();
00097
00098 void slotRun();
00099 void slotRunUntil(const QString &filename, int lineNum);
00100 void slotStepInto();
00101 void slotStepOver();
00102 void slotStepIntoIns();
00103 void slotStepOverIns();
00104 void slotStepOutOff();
00105
00106 void slotBreakInto();
00107 void slotBPState( const Breakpoint& );
00108 void slotClearAllBreakpoints();
00109
00110 void slotDisassemble(const QString &start, const QString &end);
00111 void slotMemoryDump(const QString &start, const QString &amount);
00112 void slotRegisters();
00113 void slotLibraries();
00114
00115 void slotExpandItem(TrimmableItem *parent);
00116 void slotExpandUserItem(VarItem *parent, const QCString &userRequest);
00117 void slotSelectFrame(int frameNo, int threadNo, bool needFrames);
00118 void slotSetLocalViewState(bool onOff);
00119
00120
00121 void slotVarItemConstructed(VarItem *item);
00122
00123 void slotUserGDBCmd(const QString&);
00124
00125 protected slots:
00126 void slotDbgStdout(KProcess *proc, char *buf, int buflen);
00127 void slotDbgStderr(KProcess *proc, char *buf, int buflen);
00128 void slotDbgWroteStdin(KProcess *proc);
00129 void slotDbgProcessExited(KProcess *proc);
00130
00131 signals:
00132 void acceptPendingBPs ();
00133 void unableToSetBPNow (int BPNo);
00134
00135 private:
00136 FramestackWidget* frameStack_;
00137 VariableTree* varTree_;
00138 int currentFrame_;
00139 int viewedThread_;
00140
00141 int gdbSizeofBuf_;
00142 int gdbOutputLen_;
00143 char* gdbOutput_;
00144 QCString holdingZone_;
00145
00146 QPtrList<DbgCommand> cmdList_;
00147 DbgCommand* currentCmd_;
00148
00149 STTY* tty_;
00150 QString badCore_;
00151 QString application_;
00152
00153
00154 int state_;
00155 bool programHasExited_;
00156 bool backtraceDueToProgramStop_;
00157
00158
00159 QDomDocument &dom;
00160 bool config_breakOnLoadingLibrary_;
00161 bool config_forceBPSet_;
00162 bool config_displayStaticMembers_;
00163 bool config_asmDemangle_;
00164 bool config_dbgTerminal_;
00165 QString config_gdbPath_;
00166 QString config_dbgShell_;
00167 QCString config_configGdbScript_;
00168 QCString config_runShellScript_;
00169 QCString config_runGdbScript_;
00170 int config_outputRadix_;
00171 };
00172
00173 }
00174
00175 #endif
This file is part of the documentation for KDevelop Version 3.1.2.