mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
ide: GDB watches fixed/improved
git-svn-id: svn://ultimatepp.org/upp/trunk@13656 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
288dc33b90
commit
89ea1b0149
2 changed files with 35 additions and 4 deletions
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
#define METHOD_NAME UPP_METHOD_NAME("Gdb")
|
||||
|
||||
void Gdb::WatchMenu(Bar& bar)
|
||||
{
|
||||
bool b = !IdeIsDebugLock();
|
||||
bar.Add(b, AK_CLEARWATCHES, THISBACK(ClearWatches));
|
||||
bar.Add(b, AK_ADDWATCH, THISBACK(QuickWatch));
|
||||
}
|
||||
|
||||
void Gdb::DebugBar(Bar& bar)
|
||||
{
|
||||
using namespace PdbKeys;
|
||||
|
|
@ -23,8 +30,7 @@ void Gdb::DebugBar(Bar& bar)
|
|||
bar.Add(b, AK_LOCALS, THISBACK1(SetTab, 1));
|
||||
bar.Add(b, AK_THISS, THISBACK1(SetTab, 2));
|
||||
bar.Add(b, AK_WATCHES, THISBACK1(SetTab, 3));
|
||||
bar.Add(b, AK_CLEARWATCHES, THISBACK(ClearWatches));
|
||||
bar.Add(b, AK_ADDWATCH, THISBACK(QuickWatch));
|
||||
WatchMenu(bar);
|
||||
bar.Add(b, AK_CPU, THISBACK1(SetTab, 4));
|
||||
bar.MenuSeparator();
|
||||
bar.Add(b, "Copy backtrace", THISBACK(CopyStack));
|
||||
|
|
@ -536,7 +542,6 @@ void Gdb::ClearCtrls()
|
|||
disas.Clear();
|
||||
|
||||
locals.Clear();
|
||||
watches.Clear();
|
||||
autos.Clear();
|
||||
self.Clear();
|
||||
cpu.Clear();
|
||||
|
|
@ -608,6 +613,10 @@ bool Gdb::Create(One<Host>&& _host, const String& exefile, const String& cmdline
|
|||
|
||||
Gdb::~Gdb()
|
||||
{
|
||||
StringStream ss;
|
||||
Store(callback(this, &Gdb::SerializeSession), ss);
|
||||
WorkspaceConfigData("gdb-debugger") = ss;
|
||||
|
||||
IdeRemoveBottom(*this);
|
||||
IdeRemoveRight(disas);
|
||||
KillDebugTTY();
|
||||
|
|
@ -619,6 +628,22 @@ void Gdb::Periodic()
|
|||
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_utils(GdbUtilsFactory().Create())
|
||||
{
|
||||
|
|
@ -642,7 +667,7 @@ Gdb::Gdb()
|
|||
watches.Inserting().Removing();
|
||||
watches.EvenRowColor();
|
||||
watches.WhenSel = THISBACK1(SetTree, &watches);
|
||||
watches.WhenBar = [=](Bar& bar) { Mem(bar, watches); };
|
||||
watches.WhenBar = [=](Bar& bar) { Mem(bar, watches); WatchMenu(bar); };
|
||||
autos.NoHeader();
|
||||
autos.AddColumn("", 1);
|
||||
autos.AddColumn("", 6);
|
||||
|
|
@ -704,6 +729,9 @@ Gdb::Gdb()
|
|||
Transparent();
|
||||
|
||||
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& cmdline, bool console)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public:
|
|||
void SetTab(int q);
|
||||
void SetTree(ArrayCtrl *a);
|
||||
void OnTreeBar(Bar& bar);
|
||||
void WatchMenu(Bar& bar);
|
||||
void OnTreeExpand(int node);
|
||||
void MemoryGoto();
|
||||
void MemoryLoad(const String& adr, int count, bool showerror);
|
||||
|
|
@ -97,6 +98,8 @@ public:
|
|||
|
||||
TimeCallback periodic; // Period check for killed console
|
||||
void Periodic();
|
||||
|
||||
void SerializeSession(Stream& s);
|
||||
|
||||
virtual ~Gdb() override;
|
||||
Gdb();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue