summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/stackframe.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-02-07 18:10:02 +0100
committerhjk <hjk121@nokiamail.com>2014-02-25 16:48:06 +0100
commite64fefdbc466b1247a2cee68617ad904d2388712 (patch)
tree680e4d22a99cf6244904edf3f440d8e0d549f319 /src/plugins/debugger/stackframe.cpp
parent27ae878040153904826a3b99459967e209612cde (diff)
downloadqt-creator-e64fefdbc466b1247a2cee68617ad904d2388712.tar.gz
Add a stack window menu entry to display QML stack frame.
Add language field to stack frame. Add virtual for loading QML stack invoked by stack window context menu, implement for CDB, GDB. Task-number: QTCREATORBUG-11144 Change-Id: Ic39be3978b40d96ed18cb69a8355296ec572ece7 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/debugger/stackframe.cpp')
-rw-r--r--src/plugins/debugger/stackframe.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp
index 936861ec0b..deda27431b 100644
--- a/src/plugins/debugger/stackframe.cpp
+++ b/src/plugins/debugger/stackframe.cpp
@@ -28,10 +28,13 @@
****************************************************************************/
#include "stackframe.h"
+#include "debuggerstartparameters.h"
+
#include "watchutils.h"
#include <QDebug>
#include <QDir>
+#include <QFileInfo>
#include <utils/hostosinfo.h>
@@ -45,7 +48,7 @@ namespace Internal {
////////////////////////////////////////////////////////////////////////
StackFrame::StackFrame()
- : level(-1), line(-1), address(0), usable(false)
+ : language(CppLanguage), level(-1), line(-1), address(0), usable(false)
{}
void StackFrame::clear()
@@ -90,7 +93,9 @@ QString StackFrame::toToolTip() const
str << "<tr><td>" << tr("Address:") << "</td><td>"
<< formatToolTipAddress(address) << "</td></tr>";
if (!function.isEmpty())
- str << "<tr><td>" << tr("Function:") << "</td><td>" << function << "</td></tr>";
+ str << "<tr><td>"
+ << (language == CppLanguage ? tr("Function:") : tr("JS-Function:"))
+ << "</td><td>" << function << "</td></tr>";
if (!file.isEmpty())
str << "<tr><td>" << tr("File:") << "</td><td>" << filePath << "</td></tr>";
if (line != -1)
@@ -127,6 +132,35 @@ QString StackFrame::toToolTip() const
return res;
}
+// Try to resolve files of a QML stack (resource files).
+void StackFrame::fixQmlFrame(const DebuggerStartParameters &sp)
+{
+ if (language != QmlLanguage)
+ return;
+ QFileInfo aFi(file);
+ if (aFi.isAbsolute()) {
+ usable = aFi.isFile();
+ return;
+ }
+ if (!file.startsWith(QLatin1String("qrc:/")))
+ return;
+ const QString relativeFile = file.right(file.size() - 5);
+ if (!sp.projectSourceDirectory.isEmpty()) {
+ const QFileInfo pFi(sp.projectSourceDirectory + QLatin1Char('/') + relativeFile);
+ if (pFi.isFile()) {
+ file = pFi.absoluteFilePath();
+ usable = true;
+ return;
+ }
+ const QFileInfo cFi(QDir::currentPath() + QLatin1Char('/') + relativeFile);
+ if (cFi.isFile()) {
+ file = cFi.absoluteFilePath();
+ usable = true;
+ return;
+ }
+ }
+}
+
QDebug operator<<(QDebug d, const StackFrame &f)
{
QString res;