My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#ifndef __Debuggers__
#define __Debuggers__

#include <ide/Common/Common.h>

#include <HexView/HexView.h>

#define IMAGECLASS DbgImg
#define IMAGEFILE <ide/Debuggers/Debuggers.iml>
#include <Draw/iml_header.h>

#define LAYOUTFILE <ide/Debuggers/Gdb.lay>
#include <CtrlCore/lay.h>

typedef uintptr_t adr_t;

class DbgDisas : public Ctrl {
public:
virtual void Paint(Draw& w);
virtual void Layout();
virtual void LeftDown(Point p, dword);
virtual void MouseWheel(Point, int zdelta, dword);
virtual bool Key(dword key, int);
virtual void GotFocus();
virtual void LostFocus();

private:
Index<adr_t> addr;
struct Inst : Moveable<Inst> {
String code;
String args;
};

ScrollBar sb;
Vector<Inst> inst;
Index<adr_t> taddr;
int codecx;
adr_t low, high;
int cursor;
int ip;
Image ipimg;

Size GetBox() const;
void Scroll();

typedef DbgDisas CLASSNAME;

public:
Callback WhenCursor;
Callback WhenFocus;

void Clear();
void Add(adr_t adr, const String& code, const String& args);
void AddT(adr_t tadr) { taddr.Add(tadr); }

void WriteClipboard();

void Set(const String& s);
bool InRange(adr_t adr) { return addr.Find(adr) >= 0; }
void SetCursor(adr_t adr);
adr_t GetCursor() const { return cursor >= 0 ? addr[cursor] : 0; }
void SetIp(adr_t adr, const Image& img);

DbgDisas();
};

struct Dbg : Debugger, ParentCtrl {
virtual void Stop();
virtual bool IsFinished();

One<Host> host;
One<SlaveProcess> dbg;

FrameBottom<WithRegistersLayout<StaticRect> > regs;

Vector<String> regname;
Vector<Label *> reglbl;

DbgDisas disas;

EditString watchedit;
DropList frame;
TabCtrl tab;
ArrayCtrl locals;
ArrayCtrl watches;
ArrayCtrl autos;
Label dlock;

WithQuickwatchLayout<TopWindow> quickwatch;

String file;
int line;
adr_t addr;

FileOut log;

void AddReg(const char *reg, Label *lbl) { regname.Add(reg); reglbl.Add(lbl); }

String GetHostPath(const String& path) { return host->GetHostPath(path); }
String GetLocalPath(const String& path) { return host->GetLocalPath(path); }

void Lock();
void Unlock();

String Cmd(const char *command);
String FastCmd(const char *command);

virtual bool Result(String& result, const String& s) = 0;

typedef Dbg CLASSNAME;

Dbg();
};

struct RedDisplay : public Display {
void Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword s) const;
};

const char *FindTag(const char *txt, const char *tag);
const char *AfterTag(const char *txt, const char *tag);
const char *AfterHeading(const char *txt, const char *heading);
VectorMap<String, String> DataMap(const ArrayCtrl& data);
void MarkChanged(const VectorMap<String, String>& m, ArrayCtrl& data);

struct Gdb : Dbg {
virtual bool Result(String& result, const String& s);
virtual void DebugBar(Bar& bar);
virtual bool SetBreakpoint(const String& filename, int line, const String& bp);
virtual bool RunTo();
virtual void Run();
virtual bool Key(dword key, int count);

String autoline;
bool firstrun;

bool TryBreak(const char *command);
void CheckEnd(const char *result);

void Step(const char *cmd);

String Cmdp(const char *cmdline, bool fr = false);

void DoRunTo() { RunTo(); }

void SetDisas(const String& text);
void SyncDisas(bool fr);

void DisasCursor();
void DisasFocus();
void DropFrames();
void ShowFrame();


String Print(const String& exp);
void Locals();
void Watches();
void Autos();
void Data();
void QuickWatch();

void CopyStack();
void CopyDisas();

bool Create(One<Host> host, const String& exefile, const String& cmdline);

typedef Gdb CLASSNAME;

virtual ~Gdb();
};

#include "Gdb_MI2.h"

#ifdef COMPILER_MSC
#include "Pdb.h"
#endif

#endif

Change log

r4506 by micio on Feb 1, 2012   Diff
TheIDE : Initial implementation of new GDB
debugger interface
Go to: 
Project members, sign in to write a code review

Older revisions

r967 by cxl on Mar 17, 2009   Diff
PDB debugger: watches are remembered,
Clear all watches function, Drag&Drop
to watches
r281 by mdelfede on Jun 7, 2008   Diff
changed svn layout
r66 by unodgs on Nov 18, 2007   Diff
Update to 711-dev2
All revisions of this file

File info

Size: 4064 bytes, 178 lines

File properties

svn:eol-style
native
Powered by Google Project Hosting