16
16
#include <wx/frame.h>
17
17
#include "manager.h"
19
#include <cbdebugger_interfaces.h>
19
20
#include "debugger_defs.h"
20
21
#include "debuggerdriver.h"
21
#include "debuggertree.h"
23
23
#include <wx/arrimpl.cpp>
24
WX_DEFINE_OBJARRAY(WatchesArray);
25
#if !defined(CB_TEST_PROJECT)
26
27
const int DEBUGGER_CURSOR_CHANGED = wxNewId();
27
28
const int DEBUGGER_SHOW_FILE_LINE = wxNewId();
75
75
DebuggerInfoWindow win(Manager::Get()->GetAppWindow(), m_Title, output);
79
#endif // !defined(CB_TEST_PROJECT)
81
void DebuggerBreakpoint::SetEnabled(bool flag)
86
wxString DebuggerBreakpoint::GetLocation() const
93
return filenameAsPassed;
101
int DebuggerBreakpoint::GetLine() const
106
wxString DebuggerBreakpoint::GetLineString() const
108
return (type == bptCode) ? wxString::Format(wxT("%d"), line) : wxString(wxEmptyString);
111
wxString DebuggerBreakpoint::GetType() const
120
return _("Function");
126
wxString DebuggerBreakpoint::GetInfo() const
131
if (breakOnRead && breakOnWrite)
132
return _("type: read-write");
133
else if (breakOnRead)
134
return _("type: read");
135
else if (breakOnWrite)
136
return _("type: write");
138
return _("type: unknown");
143
s += _("condition: ") + condition;
148
s += wxString::Format(_("ignore count: %d"), ignoreCount);
156
s += wxString::Format(wxT(" (index: %ld)"), index);
161
return wxEmptyString;
165
bool DebuggerBreakpoint::IsEnabled() const
170
bool DebuggerBreakpoint::IsVisibleInEditor() const
172
return type == bptCode;
175
bool DebuggerBreakpoint::IsTemporary() const
181
GDBWatch::GDBWatch(wxString const &symbol) :
190
GDBWatch::~GDBWatch()
193
void GDBWatch::GetSymbol(wxString &symbol) const
197
void GDBWatch::GetValue(wxString &value) const
201
bool GDBWatch::SetValue(const wxString &value)
203
if(m_raw_value != value)
210
void GDBWatch::GetFullWatchString(wxString &full_watch) const
212
cb::shared_ptr<const cbWatch> parent = GetParent();
215
parent->GetFullWatchString(full_watch);
216
full_watch += wxT(".") + m_symbol;
219
full_watch = m_symbol;
222
void GDBWatch::GetType(wxString &type) const
226
void GDBWatch::SetType(const wxString &type)
231
wxString const & GDBWatch::GetDebugString() const
233
return m_debug_value;
235
void GDBWatch::SetDebugValue(wxString const &value)
237
m_debug_value = value;
240
void GDBWatch::SetSymbol(const wxString& symbol)
245
void GDBWatch::DoDestroy()
250
void GDBWatch::SetFormat(WatchFormat format)
255
WatchFormat GDBWatch::GetFormat() const
260
void GDBWatch::SetArray(bool flag)
265
bool GDBWatch::IsArray() const
270
void GDBWatch::SetArrayParams(int start, int count)
272
m_array_start = start;
273
m_array_count = count;
276
int GDBWatch::GetArrayStart() const
278
return m_array_start;
281
int GDBWatch::GetArrayCount() const
283
return m_array_count;
286
void GDBWatch::SetForTooltip(bool flag)
291
bool GDBWatch::GetForTooltip() const
296
bool IsPointerType(wxString type)
301
if (type.Contains(wxT("char *")) || type.Contains(wxT("char const *")))
303
else if (type.EndsWith(wxT("*")))
305
else if (type.EndsWith(wxT("* const")))
307
else if (type.EndsWith(wxT("* volatile")))
312
// Use this function to sanitize user input which might end as the last part of GDB commands.
313
// If the last character is '\', GDB will treat it as line continuation and it will stall.
314
wxString CleanStringValue(wxString value)
316
while (value.EndsWith(wxT("\\")))