Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-7433

Tighter integration between the QML/JS and C++ debugger

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      It would be benefical to have a tighter integration between the C++ and QML/JS debugger.

      Current situation

      You can choose right now to debug either C++, QML/JS, or both when starting debugging. For the mixed case we let the two debuggers underneath run independently, and switch the UI to one of them when needed.

      Shortcomings

      Stack traces are either C++ or QML

      This is a typical stack trace one gets when hitting a breakpoint in C++ that is somehow triggered by QML/JS:

      0	Backend::helloWorld	main.cpp	15	0x804ac4b	
      1	Backend::qt_static_metacall	main.moc	48	0x804ae4a	
      2	Backend::qt_metacall	main.moc	88	0x804af28	
      3	QMetaObject::metacall	qmetaobject.cpp	245	0x13daa9c	
      4	QDeclarativeObjectMethodScriptClass::callMethod	qdeclarativeobjectscriptclass.cpp	988	0x3ba723	
      5	QDeclarativeObjectMethodScriptClass::callPrecise	qdeclarativeobjectscriptclass.cpp	948	0x3ba341	
      6	QDeclarativeObjectMethodScriptClass::call	qdeclarativeobjectscriptclass.cpp	917	0x3b9e35	
      7	QScript::DeclarativeObjectDelegate::call	qscriptdeclarativeobject.cpp	154	0x1a0f02a	
      8	QTJSC::NativeFuncWrapper::operator()	CallData.cpp	46	0x1924559	
      9	QTJSC::cti_op_call_NotJSFunction	JITStubs.cpp	1780	0x18fc7ab	
      10	QTJSC::JITThunks::tryCacheGetByID	JITStubs.cpp	926	0x18f8cdc	
      11	??				
      

      That is, there's no indication what JS expression / QML property triggered the code path. Furthermore, if the QML/JS code again was triggered by C++ code, we don't see that part either.

      This is an example stack trace from JS:

      1	onPChanged	main.qml	20		
      2	<native>				
      3	onClicked	main.qml	14		
      

      The C++ part is hidden in <native>.

      The "Interrupt" action is ambiguous

      It's unclear what the user want to interrupt when clicking 'interrupt'. For the mixed engine, we right now always forward to the C++ engine.

      State of mixed engine 'magically' switches

      Sometimes the common engine state behaves unexpectedly. An example

      • One breaks in a JS statement
      • Stepping in JS, C++ code is triggered that also has a breakpoint
      • C++ breakpoint is hit. The user then presses 'Continue'
      • The common engine switches back to the JS engine, which is still stepping

      One cannot cross-step from C++ to JS, or from C++ to JS, and back

      Either C++ or QML evaluated expressions are shown

      Attachments

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

        Activity

          People

            hjk hjk
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes