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

JavaScript breakpoints ignored after running the application once in non-debugging mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.0 RC1
    • 5.11.2, 5.12.5, 5.13.1, 5.14.0 Beta 1
    • QML: Tooling
    • Windows 10 Version 1903 build 18362.356; Visual Studio 2017; Qt 5.13.1 MSVC 2017 64-bit.
      Debian 9, Qt5.13.1 gcc
    • Linux/X11, Windows
    • 31be482e740a6aec1243eb7ba3d865b9d4050641 (qt/qtdeclarative/5.15)

    Description

      I loaded the qtdoc/examples/demos/samegame project into Qt Creator 4.11.0 beta1 open source for Windows 64-bit, on Windows 10 1903, and built it with Qt 5.13.1 MSVC 2017 64-bit in debug mode. C++ and QML were enabled in the project's debugger settings, and QML debugging/profiling enabled in the qmake build steps before building. Then I put a breakpoint in the beginning of the startNewGame() function in savegame.js. I noticed the following behavior:

      If I start the application with no debugger (Run/Ctrl+R), then quit the application and start it again using "Start debugging" or F5, the breakpoints in JavaScript code will not be triggered when starting a new game. I tried starting the application multiple times, doing a "clean" and rebuilding the project, but the JavaScript breakpoints remained ignored. However, breakpoints in C++ and QML code worked normally.

      But, if I changed anything in the JavaScript source file, like adding a blank line anywhere and saved it, then the breakpoints would suddenly start working when starting in debugging mode, and continue to work in subsequent runs in debugging mode. That's until the application is run once again in non-debugging mode. Then the js breakpoints will no longer work when it is subsequently started in debugging mode, until the js file is modified again and so on. Rebuilding, changing a C++ or QML file, or adding new breakpoints in the JavaScript code did nothing to make js breakpoints work. Only modifying the js file did the trick.

      By the way, I was able to reproduce the same behavior with Qt Creator 4.10.1, so it's either a pre-existing bug, or perhaps something in my environment or configuration. Also, I usually only debug C++ code in Qt Creator, so I'm not sure if this can be a known issue.

       

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            anrocha André De La Rocha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes