From 229ac4977aa973f9fddb08fbbd48ebc08b249e7a Mon Sep 17 00:00:00 2001 From: micio Date: Sun, 29 Apr 2012 11:13:48 +0000 Subject: [PATCH] Ide/Debuggers/Gdb_MI2 : fixed assembly level debugging git-svn-id: svn://ultimatepp.org/upp/trunk@4878 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Debuggers/Gdb_MI2.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/uppsrc/ide/Debuggers/Gdb_MI2.cpp b/uppsrc/ide/Debuggers/Gdb_MI2.cpp index f45fe755c..d0ee99b1e 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2.cpp +++ b/uppsrc/ide/Debuggers/Gdb_MI2.cpp @@ -620,6 +620,10 @@ void Gdb_MI2::SyncDisas(MIValue &fInfo, bool fr) } } + // setup disassembler cursor + disas.SetCursor(adr); + disas.SetIp(adr, fr ? DbgImg::FrameLinePtr() : DbgImg::IpLinePtr()); + // update registers MIValue rNames = MICmd("data-list-register-names")["register-names"]; IndexiNames; @@ -775,14 +779,16 @@ void Gdb_MI2::Step(const char *cmd) ReadGdb(false); } Unlock(); - if(b) - disas.SetFocus(); firstRun = false; if(stopped) CheckStopReason(); started = stopped = false; IdeActivateBottom(); + + // reset focus to disassembly pane if was there before + if(b) + disas.SetFocus(); } // setup ide cursor based on disassembler one @@ -800,7 +806,7 @@ void Gdb_MI2::DisasCursor() MIValue b = MICmd(Format("break-insert *0x%X", (int64)disas.GetCursor()))["bkpt"]; if(b.Find("file") >= 0 && b.Find("line") >= 0) IdeSetDebugPos(b["file"], atoi(b["line"].Get()) - 1, DbgImg::DisasPtr(), 1); - if(b.Find("number")) + if(b.Find("number") >= 0) MICmd(Format("break-delete %s", b["number"].Get())); disas.SetFocus();