~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/debuggergdb/gdb_driver.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 */
 
5
 
 
6
#ifndef GDB_DRIVER_H
 
7
#define GDB_DRIVER_H
 
8
 
 
9
#include "debuggerdriver.h"
 
10
#include "remotedebugging.h"
 
11
#include <wx/dynarray.h>
 
12
#include <wx/regex.h>
 
13
 
 
14
struct ScriptedType
 
15
{
 
16
    wxString name;          // STL String
 
17
    wxString regex_str;     // [^[:alnum:]_]*string[^[:alnum:]_]*
 
18
    wxRegEx regex;
 
19
    wxString eval_func;     // Evaluate_StlString
 
20
    wxString parse_func;    // Parse_StlString
 
21
 
 
22
    ScriptedType(){}
 
23
    ScriptedType(const ScriptedType& rhs)
 
24
    {
 
25
        name = rhs.name;
 
26
        regex_str = rhs.regex_str;
 
27
        eval_func = rhs.eval_func;
 
28
        parse_func = rhs.parse_func;
 
29
 
 
30
        regex.Compile(regex_str);
 
31
    }
 
32
};
 
33
 
 
34
WX_DECLARE_OBJARRAY(ScriptedType, TypesArray);
 
35
 
 
36
class GDB_driver : public DebuggerDriver
 
37
{
 
38
    public:
 
39
        GDB_driver(DebuggerGDB* plugin);
 
40
        virtual ~GDB_driver();
 
41
 
 
42
        virtual wxString GetCommandLine(const wxString& debugger, const wxString& debuggee);
 
43
        virtual wxString GetCommandLine(const wxString& debugger, int pid);
 
44
        virtual void Prepare(ProjectBuildTarget* target, bool isConsole);
 
45
        virtual void Start(bool breakOnEntry);
 
46
        virtual void Stop();
 
47
 
 
48
        virtual void Continue();
 
49
        virtual void Step();
 
50
        virtual void StepInstruction();
 
51
        virtual void StepIn();
 
52
        virtual void StepOut();
 
53
        virtual void Backtrace();
 
54
        virtual void Disassemble();
 
55
        virtual void CPURegisters();
 
56
        virtual void SwitchToFrame(size_t number);
 
57
        virtual void SetVarValue(const wxString& var, const wxString& value);
 
58
        virtual void MemoryDump();
 
59
        virtual void Detach();
 
60
        virtual void RunningThreads();
 
61
 
 
62
        void InfoFrame();
 
63
        void InfoDLL();
 
64
        void InfoFiles();
 
65
        void InfoFPU();
 
66
        void InfoSignals();
 
67
 
 
68
        virtual void SwitchThread(size_t threadIndex);
 
69
 
 
70
        virtual void AddBreakpoint(DebuggerBreakpoint* bp);
 
71
        virtual void RemoveBreakpoint(DebuggerBreakpoint* bp);
 
72
        virtual void EvaluateSymbol(const wxString& symbol, const wxRect& tipRect);
 
73
        virtual void UpdateWatches(bool doLocals, bool doArgs, DebuggerTree* tree);
 
74
        virtual void ParseOutput(const wxString& output);
 
75
        virtual wxString GetDisassemblyFlavour(void);
 
76
 
 
77
        wxString GetScriptedTypeCommand(const wxString& gdb_type, wxString& parse_func);
 
78
    protected:
 
79
    private:
 
80
        void InitializeScripting();
 
81
        void RegisterType(const wxString& name, const wxString& regex, const wxString& eval_func, const wxString& parse_func);
 
82
        void HandleMainBreakPoint(const wxRegEx& reBreak, wxString line);
 
83
 
 
84
        // win/Cygwin platform checking
 
85
        void DetectCygwinMount(void);
 
86
        void CorrectCygwinPath(wxString& path);
 
87
 
 
88
        // remote debugging
 
89
        RemoteDebugging* GetRemoteDebuggingInfo();
 
90
 
 
91
        bool m_CygwinPresent;
 
92
        wxString m_CygdrivePrefix;
 
93
 
 
94
        TypesArray m_Types;
 
95
 
 
96
        // Seems to be intended to allow step before program has started.
 
97
        // Was always false.  HC changed to take value from DebuggerGDB::m_BreakOnEntry.
 
98
        bool m_BreakOnEntry;
 
99
 
 
100
        // Seems to be used to issue a InfoProgram command, then continue
 
101
        // True after first "Start()", until first break
 
102
        bool m_ManualBreakOnEntry;
 
103
 
 
104
        // Program is "running": after a "run" or a "start", and before "kill" or a "quit"
 
105
        bool m_IsStarted;
 
106
 
 
107
        // cursor update flags
 
108
        bool m_needsUpdate;
 
109
        bool m_forceUpdate;
 
110
 
 
111
        // GDB version
 
112
        long m_GDBVersionMajor;
 
113
        long m_GDBVersionMinor;
 
114
        wxString flavour;
 
115
 
 
116
        bool want_debug_events;
 
117
        bool disable_debug_events;
 
118
 
 
119
        // for remote debugging usage (mainly)
 
120
        ProjectBuildTarget* m_pTarget;
 
121
 
 
122
}; // GDB_driver
 
123
 
 
124
#endif // GDB_DRIVER_H