Commit 8ffb0c7c authored by hjk's avatar hjk
Browse files

Debugger: Implement stack frame switching with LLDB



Change-ID: I6efed5ffdccc5ce0aa13b1e7296137396ca28efe
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7fe9bcdb
......@@ -734,7 +734,7 @@ class Dumper:
def reportLocation(self):
thread = self.currentThread()
frame = thread.GetFrameAtIndex(0)
frame = thread.GetSelectedFrame()
file = fileName(frame.line_entry.file)
line = frame.line_entry.line
self.report('location={file="%s",line="%s",addr="%s"}' % (file, line, frame.pc))
......@@ -766,7 +766,9 @@ class Dumper:
self.report('msg="No process"')
else:
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()
if n > 4:
n = 4
......@@ -1196,8 +1198,9 @@ class Dumper:
self.report('success="%d",output="%s",error="%s"'
% (result.Succeeded(), result.GetOutput(), result.GetError()))
def activateFrame(self, frame):
self.handleCommand("frame select " + frame)
def activateFrame(self, args):
self.currentThread().SetSelectedFrame(args['index'])
self.reportData()
def selectThread(self, thread):
self.handleCommand("thread select " + thread)
......
......@@ -855,6 +855,9 @@ void LldbEngine::refreshStack(const GdbMi &stack)
bool canExpand = stack["hasmore"].toInt();
debuggerCore()->action(ExpandStack)->setEnabled(canExpand);
handler->setFrames(frames);
int index = stack["current-frame"].toInt();
handler->setCurrentIndex(index);
}
void LldbEngine::refreshRegisters(const GdbMi &registers)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment