"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "uppsrc/ide/Debuggers/Gdb.cpp" between
upp-x11-src-13648.tar.gz and upp-x11-src-13659.tar.gz

About: Ultimate++ is a C++ cross-platform rapid application development framework. Stable release.

Gdb.cpp  (upp-x11-src-13648):Gdb.cpp  (upp-x11-src-13659)
#include "Debuggers.h" #include "Debuggers.h"
#define METHOD_NAME UPP_METHOD_NAME("Gdb") #define METHOD_NAME UPP_METHOD_NAME("Gdb")
void Gdb::WatchMenu(Bar& bar)
{
bool b = !IdeIsDebugLock();
bar.Add(b, PdbKeys::AK_CLEARWATCHES, THISBACK(ClearWatches));
bar.Add(b, PdbKeys::AK_ADDWATCH, THISBACK(QuickWatch));
}
void Gdb::DebugBar(Bar& bar) void Gdb::DebugBar(Bar& bar)
{ {
using namespace PdbKeys; using namespace PdbKeys;
bar.Add("Stop debugging", DbgImg::StopDebug(), THISBACK(Stop)) bar.Add("Stop debugging", DbgImg::StopDebug(), THISBACK(Stop))
.Key(K_SHIFT_F5); .Key(K_SHIFT_F5);
bar.Separator(); bar.Separator();
bool b = !IdeIsDebugLock(); bool b = !IdeIsDebugLock();
bar.Add(b, AK_STEPINTO, DbgImg::StepInto(), THISBACK1(Step, disas.HasFocu s() ? "stepi" bar.Add(b, AK_STEPINTO, DbgImg::StepInto(), THISBACK1(Step, disas.HasFocu s() ? "stepi"
: "step")); : "step"));
skipping to change at line 26 skipping to change at line 33
: "next")); : "next"));
bar.Add(b, AK_STEPOUT, DbgImg::StepOut(), THISBACK1(Step, "finish")); bar.Add(b, AK_STEPOUT, DbgImg::StepOut(), THISBACK1(Step, "finish"));
bar.Add(b, AK_RUNTO, DbgImg::RunTo(), THISBACK(DoRunTo)); bar.Add(b, AK_RUNTO, DbgImg::RunTo(), THISBACK(DoRunTo));
bar.Add(b, AK_RUN, DbgImg::Run(), THISBACK(Run)); bar.Add(b, AK_RUN, DbgImg::Run(), THISBACK(Run));
bar.Add(!b && pid, AK_BREAK, DbgImg::Stop(), THISBACK(BreakRunning)); bar.Add(!b && pid, AK_BREAK, DbgImg::Stop(), THISBACK(BreakRunning));
bar.MenuSeparator(); bar.MenuSeparator();
bar.Add(b, AK_AUTOS, THISBACK1(SetTab, 0)); bar.Add(b, AK_AUTOS, THISBACK1(SetTab, 0));
bar.Add(b, AK_LOCALS, THISBACK1(SetTab, 1)); bar.Add(b, AK_LOCALS, THISBACK1(SetTab, 1));
bar.Add(b, AK_THISS, THISBACK1(SetTab, 2)); bar.Add(b, AK_THISS, THISBACK1(SetTab, 2));
bar.Add(b, AK_WATCHES, THISBACK1(SetTab, 3)); bar.Add(b, AK_WATCHES, THISBACK1(SetTab, 3));
bar.Add(b, AK_CLEARWATCHES, THISBACK(ClearWatches)); WatchMenu(bar);
bar.Add(b, AK_ADDWATCH, THISBACK(QuickWatch));
bar.Add(b, AK_CPU, THISBACK1(SetTab, 4)); bar.Add(b, AK_CPU, THISBACK1(SetTab, 4));
bar.MenuSeparator(); bar.MenuSeparator();
bar.Add(b, "Copy backtrace", THISBACK(CopyStack)); bar.Add(b, "Copy backtrace", THISBACK(CopyStack));
bar.Add(b, "Copy backtrace of all threads", THISBACK(CopyStackAll)); bar.Add(b, "Copy backtrace of all threads", THISBACK(CopyStackAll));
bar.Add(b, "Copy dissassembly", THISBACK(CopyDisas)); bar.Add(b, "Copy dissassembly", THISBACK(CopyDisas));
} }
String FormatFrame(const char *s) String FormatFrame(const char *s)
{ {
if(*s++ != '#') if(*s++ != '#')
skipping to change at line 539 skipping to change at line 545
Cmdp("thread " + AsString(i)); Cmdp("thread " + AsString(i));
SyncFrameButtons(); SyncFrameButtons();
} }
void Gdb::ClearCtrls() void Gdb::ClearCtrls()
{ {
threads.Clear(); threads.Clear();
disas.Clear(); disas.Clear();
locals.Clear(); locals.Clear();
watches.Clear();
autos.Clear(); autos.Clear();
self.Clear(); self.Clear();
cpu.Clear(); cpu.Clear();
tree.Clear(); tree.Clear();
} }
bool Gdb::Key(dword key, int count) bool Gdb::Key(dword key, int count)
{ {
if(key >= 32 && key < 65535 && tab.Get() == 2) { if(key >= 32 && key < 65535 && tab.Get() == 2) {
skipping to change at line 611 skipping to change at line 616
Cmd("set args " + cmdline); Cmd("set args " + cmdline);
firstrun = true; firstrun = true;
running_interrupted = false; running_interrupted = false;
return true; return true;
} }
Gdb::~Gdb() Gdb::~Gdb()
{ {
StringStream ss;
Store(callback(this, &Gdb::SerializeSession), ss);
WorkspaceConfigData("gdb-debugger") = ss;
IdeRemoveBottom(*this); IdeRemoveBottom(*this);
IdeRemoveRight(disas); IdeRemoveRight(disas);
KillDebugTTY(); KillDebugTTY();
} }
void Gdb::Periodic() void Gdb::Periodic()
{ {
if(TTYQuit()) if(TTYQuit())
Stop(); Stop();
} }
void Gdb::SerializeSession(Stream& s)
{
int version = 0;
s / version;
int n = watches.GetCount();
s / n;
for(int i = 0; i < n; i++) {
String w;
if(s.IsStoring())
w = watches.Get(i, 0);
s % w;
if(s.IsLoading())
watches.Add(w);
}
}
Gdb::Gdb() Gdb::Gdb()
: gdb_utils(GdbUtilsFactory().Create()) : gdb_utils(GdbUtilsFactory().Create())
{ {
auto Mem = [=](Bar& bar, ArrayCtrl& h) { auto Mem = [=](Bar& bar, ArrayCtrl& h) {
String s = h.GetKey(); String s = h.GetKey();
if(s.GetCount()) { if(s.GetCount()) {
if(!IsAlpha(*s)) if(!IsAlpha(*s))
s = '(' + s + ')'; s = '(' + s + ')';
MemoryMenu(bar, s); MemoryMenu(bar, s);
} }
skipping to change at line 645 skipping to change at line 670
locals.AddColumn("", 6); locals.AddColumn("", 6);
locals.EvenRowColor(); locals.EvenRowColor();
locals.WhenSel = THISBACK1(SetTree, &locals); locals.WhenSel = THISBACK1(SetTree, &locals);
locals.WhenBar = [=](Bar& bar) { Mem(bar, locals); }; locals.WhenBar = [=](Bar& bar) { Mem(bar, locals); };
watches.NoHeader(); watches.NoHeader();
watches.AddColumn("", 1).Edit(watchedit); watches.AddColumn("", 1).Edit(watchedit);
watches.AddColumn("", 6); watches.AddColumn("", 6);
watches.Inserting().Removing(); watches.Inserting().Removing();
watches.EvenRowColor(); watches.EvenRowColor();
watches.WhenSel = THISBACK1(SetTree, &watches); watches.WhenSel = THISBACK1(SetTree, &watches);
watches.WhenBar = [=](Bar& bar) { Mem(bar, watches); }; watches.WhenBar = [=](Bar& bar) { Mem(bar, watches); WatchMenu(bar); };
autos.NoHeader(); autos.NoHeader();
autos.AddColumn("", 1); autos.AddColumn("", 1);
autos.AddColumn("", 6); autos.AddColumn("", 6);
autos.EvenRowColor(); autos.EvenRowColor();
autos.WhenSel = THISBACK1(SetTree, &autos); autos.WhenSel = THISBACK1(SetTree, &autos);
autos.WhenBar = [=](Bar& bar) { Mem(bar, autos); }; autos.WhenBar = [=](Bar& bar) { Mem(bar, autos); };
self.NoHeader(); self.NoHeader();
self.AddColumn("", 1); self.AddColumn("", 1);
self.AddColumn("", 6); self.AddColumn("", 6);
self.EvenRowColor(); self.EvenRowColor();
skipping to change at line 707 skipping to change at line 732
CtrlLayoutOKCancel(quickwatch, "Watch"); CtrlLayoutOKCancel(quickwatch, "Watch");
quickwatch.WhenClose = quickwatch.Breaker(IDCANCEL); quickwatch.WhenClose = quickwatch.Breaker(IDCANCEL);
quickwatch.value.SetReadOnly(); quickwatch.value.SetReadOnly();
quickwatch.value.SetFont(CourierZ(11)); quickwatch.value.SetFont(CourierZ(11));
quickwatch.Sizeable().Zoomable(); quickwatch.Sizeable().Zoomable();
quickwatch.SetRect(0, 150, 300, 400); quickwatch.SetRect(0, 150, 300, 400);
Transparent(); Transparent();
periodic.Set(-50, THISBACK(Periodic)); periodic.Set(-50, THISBACK(Periodic));
StringStream ss(WorkspaceConfigData("gdb-debugger"));
Load(callback(this, &Gdb::SerializeSession), ss);
} }
One<Debugger> GdbCreate(One<Host>&& host, const String& exefile, const String& c mdline, bool console) One<Debugger> GdbCreate(One<Host>&& host, const String& exefile, const String& c mdline, bool console)
{ {
auto dbg = MakeOne<Gdb>(); auto dbg = MakeOne<Gdb>();
if(!dbg->Create(pick(host), exefile, cmdline, console)) if(!dbg->Create(pick(host), exefile, cmdline, console))
return nullptr; return nullptr;
return pick(dbg); // CLANG does not like this without pick return pick(dbg); // CLANG does not like this without pick
} }
 End of changes. 7 change blocks. 
4 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)