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 void setDefaultInvocation(QString cmd
) { m_defaultCmd
= cmd
; }
22 static QString
defaultGdb();
23 virtual bool startup(QString cmdStr
);
24 virtual void commandFinished(CmdQueueItem
* cmd
);
25 virtual CmdQueueItem
* executeCmd(DbgCommand
,
26 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
, int intArg
,
32 bool clearLow
= false);
33 virtual CmdQueueItem
* executeCmd(DbgCommand
, QString strArg1
, QString strArg2
,
34 bool clearLow
= false);
35 virtual CmdQueueItem
* executeCmd(DbgCommand
, int intArg1
, int intArg2
,
36 bool clearLow
= false);
37 virtual CmdQueueItem
* queueCmd(DbgCommand
,
39 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg
,
41 virtual CmdQueueItem
* queueCmd(DbgCommand
, int intArg
,
43 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg
, int intArg
,
45 virtual CmdQueueItem
* queueCmd(DbgCommand
, QString strArg1
, QString strArg2
,
48 virtual void terminate();
49 virtual void detachAndTerminate();
50 virtual void interruptInferior();
51 virtual VarTree
* parseQCharArray(const char* output
, bool wantErrorValue
, bool qt3like
);
52 virtual void parseBackTrace(const char* output
, QList
<StackFrame
>& stack
);
53 virtual bool parseFrameChange(const char* output
, int& frameNo
,
54 QString
& file
, int& lineNo
, DbgAddr
& address
);
55 virtual bool parseBreakList(const char* output
, QList
<Breakpoint
>& brks
);
56 virtual bool parseThreadList(const char* output
, QList
<ThreadInfo
>& threads
);
57 virtual bool parseBreakpoint(const char* output
, int& id
,
58 QString
& file
, int& lineNo
);
59 virtual void parseLocals(const char* output
, QList
<VarTree
>& newVars
);
60 virtual bool parsePrintExpr(const char* output
, bool wantErrorValue
,
62 virtual bool parseChangeWD(const char* output
, QString
& message
);
63 virtual bool parseChangeExecutable(const char* output
, QString
& message
);
64 virtual bool parseCoreFile(const char* output
);
65 virtual uint
parseProgramStopped(const char* output
, QString
& message
);
66 virtual void parseSharedLibs(const char* output
, QStrList
& shlibs
);
67 virtual bool parseFindType(const char* output
, QString
& type
);
68 virtual void parseRegisters(const char* output
, QList
<RegisterInfo
>& regs
);
69 virtual bool parseInfoLine(const char* output
,
70 QString
& addrFrom
, QString
& addrTo
);
71 virtual void parseDisassemble(const char* output
, QList
<DisassembledCode
>& code
);
72 virtual QString
parseMemoryDump(const char* output
, QList
<MemoryDump
>& memdump
);
74 int m_gdbMajor
, m_gdbMinor
;
75 QString m_programWD
; /* just an intermediate storage */
76 QString m_redirect
; /* redirection to /dev/null */
78 QString m_defaultCmd
; /* how to invoke gdb */
80 QString
makeCmdString(DbgCommand cmd
, QString strArg
);
81 QString
makeCmdString(DbgCommand cmd
, int intArg
);
82 QString
makeCmdString(DbgCommand cmd
, QString strArg
, int intArg
);
83 QString
makeCmdString(DbgCommand cmd
, QString strArg1
, QString strArg2
);
84 QString
makeCmdString(DbgCommand cmd
, int intArg1
, int intArg2
);