From b84ce82e071978849b34750fc4d797855d5fe541 Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Wed, 1 Dec 2010 15:57:13 +0100 Subject: [PATCH] debugger: Engine decides now if a StackFrame is considered usable --- src/plugins/debugger/debuggerstreamops.cpp | 2 ++ src/plugins/debugger/gdb/gdbengine.cpp | 1 + src/plugins/debugger/qml/qmlengine.cpp | 1 + src/plugins/debugger/stackframe.cpp | 4 ++-- src/plugins/debugger/stackframe.h | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggerstreamops.cpp b/src/plugins/debugger/debuggerstreamops.cpp index 85c0438c705..067eab308a1 100644 --- a/src/plugins/debugger/debuggerstreamops.cpp +++ b/src/plugins/debugger/debuggerstreamops.cpp @@ -92,6 +92,7 @@ QDataStream &operator<<(QDataStream &stream, const StackFrame &s) stream << s.to; stream << s.line; stream << s.address; + stream << s.usable; return stream; } @@ -106,6 +107,7 @@ QDataStream &operator>>(QDataStream &stream, StackFrame &s) stream >> s.to; stream >> s.line; stream >> s.address; + stream >> s.usable; return stream; } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index d7d9e3dfe1e..385ffdfc0df 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2853,6 +2853,7 @@ StackFrame GdbEngine::parseStackFrame(const GdbMi &frameMi, int level) frame.from = _(frameMi.findChild("from").data()); frame.line = frameMi.findChild("line").data().toInt(); frame.address = frameMi.findChild("addr").data().toULongLong(0, 16); + frame.usable = QFileInfo(frame.file).isReadable(); return frame; } diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index fd65d226990..f6b180481a0 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -138,6 +138,7 @@ static QDataStream &operator>>(QDataStream &s, StackFrame &frame) s >> function >> file >> frame.line; frame.function = QString::fromUtf8(function); frame.file = QString::fromUtf8(file); + frame.usable = QFileInfo(frame.file).isReadable(); return s; } diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp index da62a225d77..4054ff9bd0a 100644 --- a/src/plugins/debugger/stackframe.cpp +++ b/src/plugins/debugger/stackframe.cpp @@ -45,7 +45,7 @@ namespace Internal { //////////////////////////////////////////////////////////////////////// StackFrame::StackFrame() - : level(-1), line(-1), address(0) + : level(-1), line(-1), address(0), usable(false) {} void StackFrame::clear() @@ -60,7 +60,7 @@ void StackFrame::clear() bool StackFrame::isUsable() const { - return !file.isEmpty() && QFileInfo(file).isReadable(); + return usable; } QString StackFrame::toString() const diff --git a/src/plugins/debugger/stackframe.h b/src/plugins/debugger/stackframe.h index d185e46abe6..22dfcbdb995 100644 --- a/src/plugins/debugger/stackframe.h +++ b/src/plugins/debugger/stackframe.h @@ -59,6 +59,7 @@ public: QString to; // Used in ScriptEngine only. qint32 line; quint64 address; + bool usable; Q_DECLARE_TR_FUNCTIONS(StackHandler) };