Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47845

add public API to QQmlEngine to retrieve a stack trace

    XMLWordPrintable

Details

    Description

      My application has a crash reporting feature to report the C++ stack trace to our developers. We would like to add the QML stack trace to our crash report as well. We've prototyped a technique to do this by cribbing ideas from console.trace(), but it requires access to private implementation details of QQmlEngine.

      I request a public API where QQmlEngine can provide an array of stack frames, from which the programmer can retrieve function, source, line number and column number. My ideal public API would be very similar to the QV4::ExecutionEngine::stackTrace() method.

      My prototyped technique is as follows:

      #include <private/qv8engine_p.h>
      #include <QQmlEngine>
      QV8Engine* v8engine = qmlEngine->handle();
      QV4::ExecutionEngine *qv4engine = QV8Engine::getV4(v8engine);
      QVector<QV4::StackFrame> stackTrace = qv4engine->stackTrace();

      Instead, I'd like to be able to do something like this:

      #include <QQmlEngine>
      QVector<QQmlEngine::StackFrame> stackTrace = qmlEngine->stackTrace();

      Attachments

        Activity

          People

            qtqmlteam Qt Qml Team User
            chrisdolan Chris Dolan
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: