2 * Copyright Johannes Sixt, Keith Isdale
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
10 #include "dbgdriver.h"
14 class XsldbgDriver
:public DebuggerDriver
{
19 virtual QString
driverName() const;
20 virtual QString
defaultInvocation() const;
21 virtual QStringList
boolOptionList() const;
22 static QString
defaultXsldbg();
23 virtual bool startup(QString cmdStr
);
24 virtual void commandFinished(CmdQueueItem
* cmd
);
25 void slotReceiveOutput(KProcess
* process
, char *buffer
, int buflen
);
27 virtual CmdQueueItem
*executeCmd(DbgCommand
, bool clearLow
= false);
28 virtual CmdQueueItem
*executeCmd(DbgCommand
, QString strArg
,
29 bool clearLow
= false);
30 virtual CmdQueueItem
*executeCmd(DbgCommand
, int intArg
,
31 bool clearLow
= false);
32 virtual CmdQueueItem
*executeCmd(DbgCommand
, QString strArg
,
33 int intArg
, bool clearLow
= false);
34 virtual CmdQueueItem
*executeCmd(DbgCommand
, QString strArg1
,
35 QString strArg2
, bool clearLow
=
37 virtual CmdQueueItem
*executeCmd(DbgCommand
, int intArg1
, int intArg2
,
38 bool clearLow
= false);
39 virtual CmdQueueItem
*queueCmd(DbgCommand
, QueueMode mode
);
40 virtual CmdQueueItem
*queueCmd(DbgCommand
, QString strArg
,
42 virtual CmdQueueItem
*queueCmd(DbgCommand
, int intArg
, QueueMode mode
);
43 virtual CmdQueueItem
*queueCmd(DbgCommand
, QString strArg
, int intArg
,
45 virtual CmdQueueItem
*queueCmd(DbgCommand
, QString strArg1
,
46 QString strArg2
, QueueMode mode
);
48 virtual void terminate();
49 virtual void detachAndTerminate();
50 virtual void interruptInferior();
52 virtual void setPrintQStringDataCmd(const char* cmd
);
54 * Parses the output as an array of QChars.
56 virtual ExprValue
*parseQCharArray(const char *output
,
57 bool wantErrorValue
, bool qt3like
);
59 virtual void parseBackTrace(const char *output
,
60 std::list
< StackFrame
> &stack
);
61 virtual bool parseFrameChange(const char *output
, int &frameNo
,
62 QString
& file
, int &lineNo
,
64 virtual bool parseBreakList(const char *output
,
65 std::list
< Breakpoint
> &brks
);
66 virtual std::list
<ThreadInfo
> parseThreadList(const char *output
);
67 virtual bool parseBreakpoint(const char *output
, int &id
,
68 QString
& file
, int &lineNo
, QString
& address
);
69 virtual void parseLocals(const char *output
,
70 std::list
< ExprValue
* > &newVars
);
71 virtual ExprValue
* parsePrintExpr(const char *output
, bool wantErrorValue
);
72 virtual bool parseChangeWD(const char *output
, QString
& message
);
73 virtual bool parseChangeExecutable(const char *output
,
75 virtual bool parseCoreFile(const char *output
);
76 virtual uint
parseProgramStopped(const char *output
,
78 virtual QStringList
parseSharedLibs(const char *output
);
79 virtual bool parseFindType(const char *output
, QString
& type
);
80 virtual std::list
<RegisterInfo
> parseRegisters(const char *output
);
81 virtual bool parseInfoLine(const char *output
, QString
& addrFrom
,
83 virtual std::list
<DisassembledCode
> parseDisassemble(const char *output
);
84 virtual QString
parseMemoryDump(const char *output
,
85 std::list
< MemoryDump
> &memdump
);
86 virtual QString
parseSetVariable(const char* output
);
89 int m_gdbMajor
, m_gdbMinor
;
90 QString m_programWD
; /* just an intermediate storage */
91 QString m_xslFile
; /* needed to display it initially */
92 bool m_haveDataFile
; /* have we set the XML data file to use? */
93 QString m_redirect
; /* redirection to /dev/null */
97 QString
makeCmdString(DbgCommand cmd
, QString strArg
);
98 QString
makeCmdString(DbgCommand cmd
, int intArg
);
99 QString
makeCmdString(DbgCommand cmd
, QString strArg
, int intArg
);
100 QString
makeCmdString(DbgCommand cmd
, QString strArg1
,
102 QString
makeCmdString(DbgCommand cmd
, int intArg1
, int intArg2
);
106 #endif // XSLDBGDRIVER_H