forked from qt-creator/qt-creator
Debugger: Make LldbEngine stack handling more similar to GdbEngine
This also addresses the remaining issues of QTCREATORBUG-13803. Task-number: QTCREATORBUG-13803 Change-Id: Iceb123279236d98961d15fe7421acc7c10d1b1c7 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -434,10 +434,6 @@ void LldbEngine::handleResponse(const QByteArray &response)
|
||||
watchHandler()->addDumpers(item);
|
||||
else if (name == "stack")
|
||||
refreshStack(item);
|
||||
else if (name == "stack-position")
|
||||
refreshStackPosition(item);
|
||||
else if (name == "stack-top")
|
||||
refreshStackTop(item);
|
||||
else if (name == "registers")
|
||||
refreshRegisters(item);
|
||||
else if (name == "threads")
|
||||
@@ -526,11 +522,12 @@ void LldbEngine::executeJumpToLine(const ContextData &data)
|
||||
|
||||
void LldbEngine::activateFrame(int frameIndex)
|
||||
{
|
||||
resetLocation();
|
||||
if (state() != InferiorStopOk && state() != InferiorUnrunnable)
|
||||
return;
|
||||
|
||||
const int n = stackHandler()->stackSize();
|
||||
StackHandler *handler = stackHandler();
|
||||
|
||||
const int n = handler->stackSize();
|
||||
if (frameIndex == n) {
|
||||
DebuggerCommand cmd("reportStack");
|
||||
cmd.arg("nativeMixed", isNativeMixedActive());
|
||||
@@ -539,6 +536,10 @@ void LldbEngine::activateFrame(int frameIndex)
|
||||
return;
|
||||
}
|
||||
|
||||
QTC_ASSERT(frameIndex < handler->stackSize(), return);
|
||||
handler->setCurrentIndex(frameIndex);
|
||||
gotoLocation(handler->currentFrame());
|
||||
|
||||
DebuggerCommand cmd("activateFrame");
|
||||
cmd.arg("index", frameIndex);
|
||||
cmd.arg("thread", threadsHandler()->currentThread().raw());
|
||||
@@ -786,11 +787,6 @@ void LldbEngine::refreshSymbols(const GdbMi &symbols)
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void LldbEngine::resetLocation()
|
||||
{
|
||||
DebuggerEngine::resetLocation();
|
||||
}
|
||||
|
||||
bool LldbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget, const DebuggerToolTipContext &context)
|
||||
{
|
||||
if (state() != InferiorStopOk || !isCppEditor(editorWidget)) {
|
||||
@@ -1030,25 +1026,6 @@ void LldbEngine::refreshStack(const GdbMi &stack)
|
||||
handler->setFrames(frames, canExpand);
|
||||
}
|
||||
|
||||
void LldbEngine::refreshStackPosition(const GdbMi &position)
|
||||
{
|
||||
setStackPosition(position["id"].toInt());
|
||||
}
|
||||
|
||||
void LldbEngine::refreshStackTop(const GdbMi &)
|
||||
{
|
||||
setStackPosition(stackHandler()->firstUsableIndex());
|
||||
}
|
||||
|
||||
void LldbEngine::setStackPosition(int index)
|
||||
{
|
||||
StackHandler *handler = stackHandler();
|
||||
handler->setFrames(handler->frames());
|
||||
handler->setCurrentIndex(index);
|
||||
if (index >= 0 && index < handler->stackSize())
|
||||
gotoLocation(handler->frameAt(index));
|
||||
}
|
||||
|
||||
void LldbEngine::refreshRegisters(const GdbMi ®isters)
|
||||
{
|
||||
RegisterHandler *handler = registerHandler();
|
||||
|
||||
Reference in New Issue
Block a user