Don't try to list threads if there is no program.
[kdbg.git] / kdbg / xsldbgdriver.h
blobeb4ba0e6055751e80d67f84e00ef3256841cf46c
1 // $Id$
3 // Copyright by Johannes Sixt, Keith Isdale
4 // This file is under GPL, the GNU General Public Licence
6 #ifndef XSLDBGDRIVER_H
7 #define XSLDBGDRIVER_H
9 #include "dbgdriver.h"
10 #include "qregexp.h"
13 class XsldbgDriver:public DebuggerDriver {
14 Q_OBJECT public:
15 XsldbgDriver();
16 ~XsldbgDriver();
18 virtual QString driverName() const;
19 virtual QString defaultInvocation() const;
20 virtual QStringList boolOptionList() const;
21 static QString defaultXsldbg();
22 virtual bool startup(QString cmdStr);
23 virtual void commandFinished(CmdQueueItem * cmd);
24 void slotReceiveOutput(KProcess * process, char *buffer, int buflen);
26 virtual CmdQueueItem *executeCmd(DbgCommand, bool clearLow = false);
27 virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg,
28 bool clearLow = false);
29 virtual CmdQueueItem *executeCmd(DbgCommand, int intArg,
30 bool clearLow = false);
31 virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg,
32 int intArg, bool clearLow = false);
33 virtual CmdQueueItem *executeCmd(DbgCommand, QString strArg1,
34 QString strArg2, bool clearLow =
35 false);
36 virtual CmdQueueItem *executeCmd(DbgCommand, int intArg1, int intArg2,
37 bool clearLow = false);
38 virtual CmdQueueItem *queueCmd(DbgCommand, QueueMode mode);
39 virtual CmdQueueItem *queueCmd(DbgCommand, QString strArg,
40 QueueMode mode);
41 virtual CmdQueueItem *queueCmd(DbgCommand, int intArg, QueueMode mode);
42 virtual CmdQueueItem *queueCmd(DbgCommand, QString strArg, int intArg,
43 QueueMode mode);
44 virtual CmdQueueItem *queueCmd(DbgCommand, QString strArg1,
45 QString strArg2, QueueMode mode);
47 virtual void terminate();
48 virtual void detachAndTerminate();
49 virtual void interruptInferior();
51 /**
52 * Parses the output as an array of QChars.
54 virtual VarTree *parseQCharArray(const char *output,
55 bool wantErrorValue, bool qt3like);
57 virtual void parseBackTrace(const char *output,
58 QList < StackFrame > &stack);
59 virtual bool parseFrameChange(const char *output, int &frameNo,
60 QString & file, int &lineNo,
61 DbgAddr & address);
62 virtual bool parseBreakList(const char *output,
63 QList < Breakpoint > &brks);
64 virtual bool parseThreadList(const char *output,
65 QList < ThreadInfo > &threads);
66 virtual bool parseBreakpoint(const char *output, int &id,
67 QString & file, int &lineNo, QString& address);
68 virtual void parseLocals(const char *output,
69 QList < VarTree > &newVars);
70 virtual bool parsePrintExpr(const char *output, bool wantErrorValue,
71 VarTree * &var);
72 virtual bool parseChangeWD(const char *output, QString & message);
73 virtual bool parseChangeExecutable(const char *output,
74 QString & message);
75 virtual bool parseCoreFile(const char *output);
76 virtual uint parseProgramStopped(const char *output,
77 QString & message);
78 virtual void parseSharedLibs(const char *output, QStrList & shlibs);
79 virtual bool parseFindType(const char *output, QString & type);
80 virtual void parseRegisters(const char *output,
81 QList < RegisterInfo > &regs);
82 virtual bool parseInfoLine(const char *output, QString & addrFrom,
83 QString & addrTo);
84 virtual void parseDisassemble(const char *output,
85 QList < DisassembledCode > &code);
86 virtual QString parseMemoryDump(const char *output,
87 QList < MemoryDump > &memdump);
88 virtual QString parseSetVariable(const char* output);
90 protected:
91 int m_gdbMajor, m_gdbMinor;
92 QString m_programWD; /* just an intermediate storage */
93 QString m_xslFile; /* needed to display it initially */
94 bool m_haveDataFile; /* have we set the XML data file to use? */
95 QString m_redirect; /* redirection to /dev/null */
96 bool m_haveCoreFile;
97 QRegExp m_markerRE;
99 QString makeCmdString(DbgCommand cmd, QString strArg);
100 QString makeCmdString(DbgCommand cmd, int intArg);
101 QString makeCmdString(DbgCommand cmd, QString strArg, int intArg);
102 QString makeCmdString(DbgCommand cmd, QString strArg1,
103 QString strArg2);
104 QString makeCmdString(DbgCommand cmd, int intArg1, int intArg2);
105 void parseMarker();
108 #endif // XSLDBGDRIVER_H