3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
12 class GdbDriver
: public DebuggerDriver
19 virtual QString
driverName() const;
20 virtual QString
defaultInvocation() const;
21 virtual QStringList
boolOptionList() const;
22 void setDefaultInvocation(QString cmd
) { m_defaultCmd
= cmd
; }
23 static QString
defaultGdb();
24 virtual bool startup(QString cmdStr
);
25 virtual void commandFinished(CmdQueueItem
* cmd
);
26 virtual CmdQueueItem
* executeCmd(DbgCommand
,
27 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
, int intArg
,
33 bool clearLow
= false);
34 virtual CmdQueueItem
* executeCmd(DbgCommand
, QString strArg1
, QString strArg2
,
35 bool clearLow
= false);
36 virtual CmdQueueItem
* executeCmd(DbgCommand
, int intArg1
, int intArg2
,
37 bool clearLow
= false);
38 virtual CmdQueueItem
* queueCmd(DbgCommand
,
40 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg
,
42 virtual CmdQueueItem
* queueCmd(DbgCommand
, int intArg
,
44 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg
, int intArg
,
46 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg1
, QString strArg2
,
49 virtual void terminate();
50 virtual void detachAndTerminate();
51 virtual void interruptInferior();
52 virtual void setPrintQStringDataCmd(const char* cmd
);
53 virtual VarTree
* parseQCharArray(const char* output
, bool wantErrorValue
, bool qt3like
);
54 virtual void parseBackTrace(const char* output
, QList
<StackFrame
>& stack
);
55 virtual bool parseFrameChange(const char* output
, int& frameNo
,
56 QString
& file
, int& lineNo
, DbgAddr
& address
);
57 virtual bool parseBreakList(const char* output
, QList
<Breakpoint
>& brks
);
58 virtual bool parseThreadList(const char* output
, QList
<ThreadInfo
>& threads
);
59 virtual bool parseBreakpoint(const char* output
, int& id
,
60 QString
& file
, int& lineNo
, QString
& address
);
61 virtual void parseLocals(const char* output
, QList
<VarTree
>& newVars
);
62 virtual bool parsePrintExpr(const char* output
, bool wantErrorValue
,
64 virtual bool parseChangeWD(const char* output
, QString
& message
);
65 virtual bool parseChangeExecutable(const char* output
, QString
& message
);
66 virtual bool parseCoreFile(const char* output
);
67 virtual uint
parseProgramStopped(const char* output
, QString
& message
);
68 virtual void parseSharedLibs(const char* output
, QStrList
& shlibs
);
69 virtual bool parseFindType(const char* output
, QString
& type
);
70 virtual void parseRegisters(const char* output
, QList
<RegisterInfo
>& regs
);
71 virtual bool parseInfoLine(const char* output
,
72 QString
& addrFrom
, QString
& addrTo
);
73 virtual void parseDisassemble(const char* output
, QList
<DisassembledCode
>& code
);
74 virtual QString
parseMemoryDump(const char* output
, QList
<MemoryDump
>& memdump
);
75 virtual QString
parseSetVariable(const char* output
);
76 virtual QString
editableValue(VarTree
* value
);
78 int m_gdbMajor
, m_gdbMinor
;
79 QString m_programWD
; /* just an intermediate storage */
80 QString m_redirect
; /* redirection to /dev/null */
82 QString m_defaultCmd
; /* how to invoke gdb */
84 QString
makeCmdString(DbgCommand cmd
, QString strArg
);
85 QString
makeCmdString(DbgCommand cmd
, int intArg
);
86 QString
makeCmdString(DbgCommand cmd
, QString strArg
, int intArg
);
87 QString
makeCmdString(DbgCommand cmd
, QString strArg1
, QString strArg2
);
88 QString
makeCmdString(DbgCommand cmd
, int intArg1
, int intArg2
);