Debugger: Implement stack frame switching with LLDB

Change-ID: I6efed5ffdccc5ce0aa13b1e7296137396ca28efe
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2013-05-24 10:14:11 +02:00
parent 7fe9bcdb07
commit 8ffb0c7c1f
2 changed files with 10 additions and 4 deletions

View File

@@ -734,7 +734,7 @@ class Dumper:
def reportLocation(self): def reportLocation(self):
thread = self.currentThread() thread = self.currentThread()
frame = thread.GetFrameAtIndex(0) frame = thread.GetSelectedFrame()
file = fileName(frame.line_entry.file) file = fileName(frame.line_entry.file)
line = frame.line_entry.line line = frame.line_entry.line
self.report('location={file="%s",line="%s",addr="%s"}' % (file, line, frame.pc)) self.report('location={file="%s",line="%s",addr="%s"}' % (file, line, frame.pc))
@@ -766,7 +766,9 @@ class Dumper:
self.report('msg="No process"') self.report('msg="No process"')
else: else:
thread = self.currentThread() thread = self.currentThread()
result = 'stack={current-thread="%s",frames=[' % thread.GetThreadID() result = 'stack={current-frame="%s"' % thread.GetSelectedFrame().GetFrameID()
result += ',current-thread="%s"' % thread.GetThreadID()
result += ',frames=['
n = thread.GetNumFrames() n = thread.GetNumFrames()
if n > 4: if n > 4:
n = 4 n = 4
@@ -1196,8 +1198,9 @@ class Dumper:
self.report('success="%d",output="%s",error="%s"' self.report('success="%d",output="%s",error="%s"'
% (result.Succeeded(), result.GetOutput(), result.GetError())) % (result.Succeeded(), result.GetOutput(), result.GetError()))
def activateFrame(self, frame): def activateFrame(self, args):
self.handleCommand("frame select " + frame) self.currentThread().SetSelectedFrame(args['index'])
self.reportData()
def selectThread(self, thread): def selectThread(self, thread):
self.handleCommand("thread select " + thread) self.handleCommand("thread select " + thread)

View File

@@ -855,6 +855,9 @@ void LldbEngine::refreshStack(const GdbMi &stack)
bool canExpand = stack["hasmore"].toInt(); bool canExpand = stack["hasmore"].toInt();
debuggerCore()->action(ExpandStack)->setEnabled(canExpand); debuggerCore()->action(ExpandStack)->setEnabled(canExpand);
handler->setFrames(frames); handler->setFrames(frames);
int index = stack["current-frame"].toInt();
handler->setCurrentIndex(index);
} }
void LldbEngine::refreshRegisters(const GdbMi &registers) void LldbEngine::refreshRegisters(const GdbMi &registers)