Details

    • Sub-task
    • Resolution: Invalid
    • P2: Important
    • 4.8.0
    • Qt Script
    • None

    Description

      Since Qt 4.4, QScriptEngine provides a setAgent() function so that an application can receive callbacks when "interesting" events occur in the script engine; see http://doc.trolltech.com/4.7/qscriptengine.html#setAgent.

      The use case for this API is to be able to implement debugging- and profiling-related tools. For example, the QScriptEngineDebugger class introduced in Qt 4.5 is built on top of QScriptEngineAgent.

      The API uses a "push" model; every low-level event in the engine (such as function entry/exit, new statement reached) is sent to the agent, and it is then up to the agent to translate the event into something meaningful, e.g. "breakpoint hit" or "step out completed".

      This API requires deep hooks into the virtual machine, which makes it difficult to implement on top of other JS engines (JavaScriptCore, V8). It also relies on JS being executed in a certain way, making it more difficult to change internals of the VM (e.g. adding new optimizations).

      It would be preferable to instead offer a "subscribe" model, where you subscribe to "semantic" (high-level) events that you're interested in. Every back-end needs to have a way to e.g. set breakpoints and receive notification when they are triggered, which is an example of what we should provide an API for.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kenthans Kent Hansen (Inactive)
              kenthans Kent Hansen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes