Having trouble with Qt Creator Debugging



  • Hi All,

    I am having trouble with the debugger not working. It just hangs something might be wrong with my setup. I am a newbie :) so it might be trivial ...

    I am on Maverick (OSX) using Qt Creator. I am trying to list a folder content. I will post all specs bellow.
    Xcode 6.01 is installed.

    Any help would be much appreciated. Thank you,

    Geza

    QtCreator info
    Qt Creator 3.2.1 (opensource)
    Based on Qt 5.3.2 (Clang 5.0 (Apple), 64 bit)
    Built on Sep 12 2014 at 15:41:30
    From revision 602746950b

    main.cpp
    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    @
    int main(int argc, char *argv[])
    {
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    
    return app.exec();
    

    }
    @

    main.qml
    @
    import QtQuick 2.3
    import QtQuick.Window 2.2
    import Qt.labs.folderlistmodel 2.1

    Window {
    id: hello
    width: 1000
    height: 500
    title: "Hello"
    visible: true
    color: "#FFFFFF"

    Column {
        id: column1
        x: 0
        y: 0
        width: 200
        height: 500
        ListView {
            width: 180; height: 200
            model:  ListModel {
                ListElement {
                    name: "Bill Smith"
                    number: "555 3264"
    
                }
                ListElement {
                    name: "John Brown"
                    number: "555 8426"
                }
                ListElement {
                    name: "Sam Wise"
                    number: "555 0473"
                }
            }
            delegate: Text {
                text: name + ": " + number
            }
        }
    
    
    }
    
    Column {
        id: column2
        x: 199
        y: 0
        width: 801
        height: 500
    
        ListView {
            width: 200; height: 400
    
            model: FolderListModel {
                folder: "/Applications"
                nameFilters: ["*.qml"]
                }
            delegate:Text { text: fileName }
        }
    }
    

    }
    @



  • debugger output
    sStarting debugger "LldbEngine" for ABI "x86-macos-generic-mach_o-64bit"...
    dStart parameters: 'QuickProject' mode: 1
    dABI: x86-macos-generic-mach_o-64bit
    dLanguages: c++
    dExecutable: /Users/geza/build-QuickProject-General-Debug/QuickProject.app/Contents/MacOS/QuickProject
    dDirectory: /Users/geza/build-QuickProject-General-Debug/QuickProject.app/Contents/MacOS
    dDebugger: /Applications/Xcode.app/Contents/Developer/usr/bin/lldb
    dProject: /Users/geza/QuickProject (built: /Users/geza/build-QuickProject-General-Debug)
    dQML server: 127.0.0.1:3768
    dRemote: :0
    dSysroot:
    dDebug Source Location:
    dDebugger settings:
    dStationaryEditorWhileStepping: false (default: false)
    dRaiseOnInterrupt: true (default: true)
    dUseCodeModel: true (default: true)
    dUseDebuggingHelper: true (default: true)
    dCloseBuffersOnExit: false (default: false)
    dBreakpointsFullPath: false (default: false)
    dSwitchModeOnExit: false (default: false)
    dAutoQuit: false (default: false)
    dVerboseLog: false (default: false)
    dLogTimeStamps: false (default: false)
    dUseAlternatingRowColours: false (default: false)
    dUseMessageBoxForSignals: true (default: true)
    dFontSizeFollowsEditor: false (default: false)
    dSourcePaths: (default: )
    dSymbolPaths: (default: )
    dBreakOnCrtDbgReport: false (default: false)
    dBreakEvent: (default: )
    dExtraDumperFile: (default: )
    dAlwaysAdjustColumnWidths: true (default: true)
    dAdditionalArguments: (default: )
    dGdbCustomDumperCommands: (default: )
    dUseAddressInBreakpointsView: false (default: false)
    dUseToolTipsInBreakpointsView: true (default: true)
    dUseAddressInStackView: false (default: false)
    dUseToolTips: true (default: true)
    dShowThreadNames: false (default: false)
    dUseToolTipsInBreakpointsView: true (default: false) ***
    dUseToolTipsInLocalsView: false (default: false)
    dMultiInferior: false (default: false)
    dWarnOnReleaseBuilds: true (default: true)
    dIdentifyDebugInfoPackages: false (default: false)
    dIntelFlavor: false (default: false)
    dAutoEnrichParameters: true (default: true)
    dWatchdogTimeout: 20 (default: 20)
    dTargetAsync: false (default: false)
    dUseDynamicType: true (default: true)
    dAttemptQuickStart: false (default: false)
    dLoadGdbDumpers1: true (default: true)
    dGdbPostAttachCommands: (default: )
    dGdbStartupCommands: (default: )
    dBreakpointCorrection: true (default: true)
    dCDB_Console: false (default: false)
    dLoadGdbInit: true (default: true)
    dIgnoreFirstChanceAccessViolation: false (default: false)
    dAllPluginBreakpoints: true (default: true)
    dAdjustBreakpointLocations: true (default: true)
    dSelectedPluginBreakpoints: false (default: false)
    dListSourceFiles: false (default: false)
    dDisplayStringLimit: 100 (default: 100)
    dEnableReverseDebugging: false (default: false)
    dSkipKnownFrames: false (default: false)
    dSortStructMembers: true (default: true)
    dShowQtNamespace: true (default: true)
    dMaximalStringLength: 10000 (default: 10000)
    dAutoDerefPointers: true (default: true)
    dMaximalStackDepth: 20 (default: 20)
    dShowStandardNamespace: true (default: true)
    dQmlInspector.FromQml: false (default: false)
    dQmlInspector.ShowAppOnTop: false (default: false)
    dBreakOnFatal: false (default: false)
    dBreakOnWarning: false (default: false)
    dShowQmlObjectTree: true (default: true)
    dBreakOnAbort: false (default: false)
    dSelectedPluginBreakpointsPattern: .* (default: .*)
    dNoPluginBreakpoints: false (default: false)
    dBreakOnCatch: false (default: false)
    dBreakOnThrow: false (default: false)
    dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
    dQUEUE: SETUP ENGINE
    dCALL: SETUP ENGINE
    dSTARTING LLDB -i /Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py /Applications/Xcode.app/Contents/Developer/usr/bin/lldb

    dLldb stdout: lldbversion="lldb-320.4.124.10"@
    dstate="enginesetupok"@
    dNOTE: ENGINE SETUP OK
    dState changed from EngineSetupRequested(1) to EngineSetupOk(3) [master]
    dQUEUE: SETUP INFERIOR
    dState changed from EngineSetupOk(3) to InferiorSetupRequested(4) [master]
    dQUEUE: SETUP INFERIOR
    dCALL: SETUP INFERIOR
    <1{"cmd":"setupInferior","executable":"/Users/geza/build-QuickProject-General-Debug/QuickProject.app/Contents/MacOS/QuickProject","breakOnMain":0,"useTerminal":0,"startMode":1,"processArgs":[],"startMode":1,"attachPid":-1,"sysRoot":"","remoteChannel":"","platform":"","token":1}

    dLldb stdout: state="inferiorsetupok",msg="success",exe="/Users/geza/build-QuickProject-General-Debug/QuickProject.app/Contents/MacOS/QuickProject"@
    dtoken="1"@
    dNOTE: INFERIOR SETUP OK
    dState changed from InferiorSetupRequested(4) to InferiorSetupOk(6) [master]
    dState changed from InferiorSetupOk(6) to EngineRunRequested(7) [master]
    dQUEUE: RUN ENGINE
    dCALL: RUN ENGINE
    sRunning requested...
    <2{"cmd":"runEngine","token":2}
    dLldb stdout: token="2"@

    dQUIT DEBUGGER REQUESTED IN STATE 7
    dNOTE: ENGINE RUN FAILED
    sRun failed.
    dState changed from EngineRunRequested(7) to EngineRunFailed(8) [master]
    dState changed from EngineRunFailed(8) to EngineShutdownRequested(20) [master]
    dQUEUE: SHUTDOWN ENGINE
    dQUIT DEBUGGER REQUESTED IN STATE 20
    dCALL: SHUTDOWN ENGINE
    dNOTE: ENGINE SHUTDOWN OK
    dState changed from EngineShutdownRequested(20) to EngineShutdownOk(22) [master]
    dState changed from EngineShutdownOk(22) to DebuggerFinished(23) [master]
    dQUEUE: FINISH DEBUGGER
    dNOTE: FINISH DEBUGGER
    dHANDLE RUNCONTROL FINISHED
    sDebugger finished.
    dHANDLE LLDB ERROR
    dLLDB PROCESS FINISHED, status 1, code 0
    dNOTE: ENGINE SPONTANEOUS SHUTDOWN
    dState changed BY FORCE from DebuggerFinished(23) to EngineShutdownOk(22) [master]
    dState changed from EngineShutdownOk(22) to DebuggerFinished(23) [master]
    dQUEUE: FINISH DEBUGGER
    dNOTE: FINISH DEBUGGER



  • When it hangs: open the view "Debugger Log" and click the little button "repeat last command for debug reasons".

    I guess it will be fixed soon.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Xcode 6 has brought some modification that has break the support for lldb so you might be hit by that. Have a look at the interest mailing list thread called "LLDB hangs while being launched on Mac OS X"

    It might be of use

    Hope it helps



  • I also encountered that issue with xcode6.
    Hoping Qt release a new version to fix this.



  • Thank you so much ! I'll try both and let you know.



  • SGaist
    I can not find the exact thread you might be referring to but the following search
    http://qt-project.org/search?search=LLDB+hangs
    doesn't yield much help ... or shall I say solution ; )

    vemod
    The method you suggest gives me the following output.
    <3{"cmd":"","token":3}
    dLldb stdout:
    d
    dWARNING="**** CAUGHT EXCEPTION: MAIN LOOP ****",
    d
    dLldb stdout: pid="15633"@
    dstate="enginerunandinferiorrunok"@
    dNOTE: ENGINE RUN AND INFERIOR RUN OK
    sRunning.
    dState changed from EngineRunRequested(7) to InferiorRunOk(11) [master]
    dLldb stdout: event={type="1",data="0x7fc502f521b0 Event: broadcaster = 0x7fc503244030 (lldb.process), type = 0x00000001 (state-changed), data = { process = 0x7fc503244000 (pid = 15633), state = running}",msg="None",flavor="Process::ProcessEventData",state="6"}@
    dstate="running"@
    dNOTE: INFERIOR RUN OK - REPEATED.
    dLldb stdout:
    d
    dWARNING="Traceback (most recent call last):
    d
    d File '/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py', line 1703, in doit
    d db.execute(convertHash(json.loads(line)))
    d
    d File '/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py', line 1664, in execute
    d getattr(self, args['cmd'])(args)
    d
    dAttributeError: Dumper instance has no attribute ''
    d",
    d
    dLldb stdout: event={type="4",data="0x7fc502d922d0 Event: broadcaster = 0x7fc503244030 (lldb.process), type = 0x00000004 (stdout-available), data = { process = 0x7fc503244000 (pid = 15633), state = running}",msg="None",flavor="Process::ProcessEventData",state="6"}@
    doutput={channel="stdout",data="514d4c20646562756767696e6720697320656e61626c65642e204f6e6c7920757365207468697320696e2061207361666520656e7669726f6e6d656e742e0d0a"}@
    QML debugging is enabled. Only use this in a safe environment.



  • What do you all think ... Am I attempting the impossible here ? Shall I try uninstall xcode and install and earlier version?





  • Well done guys thank you so much !

    http://permalink.gmane.org/gmane.comp.lib.qt.user/13546



  • Sorry turigeza... I have the same trouble, I had read the http://permalink.gmane.org/gmane.comp.lib.qt.user/13546. I had found the lldbbridge.py file in this address: ~/Qt5.3.2/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py

    the patch say this

    @
    --- a/share/qtcreator/debugger/lldbbridge.py
    +++ b/share/qtcreator/debugger/lldbbridge.py
    <at> <at> -667,8 +667,9 <at> <at> class Dumper(DumperBase):
    def runEngine(self, _):

    •    self.prepare()
         s = threading.Thread(target=self.loop, args=[])
         s.start()
      
    • def loop(self):
    • def prepare(self):
      error = lldb.SBError()
      listener = self.debugger.GetListener()

    <at> <at> -710,5 +711,7 <at> <at> class Dumper(DumperBase):
    self.report('pid="%s"' % self.process.GetProcessID())
    self.reportState("enginerunandinferiorrunok")

    • def loop(self):
      event = lldb.SBEvent()
    •    listener = self.debugger.GetListener()
         while True:
      

    @

    but I didn't know what to do with this part:

    @<at> <at> -710,5 +711,7 <at> <at> class Dumper(DumperBase):
    self.report('pid="%s"' % self.process.GetProcessID())
    self.reportState("enginerunandinferiorrunok")

    • def loop(self):
      event = lldb.SBEvent()
    •    listener = self.debugger.GetListener()
         while True:@
      

    I really didn't know what to do with this part... can you giveme some advice ?

    I have OS X 10.9.5

    best regards

    Freddy



  • Hi Freddy,

    I have posted the wrong link sorry ... it was late last night.

    The patch.
    https://codereview.qt-project.org/#/c/95516/

    Direct link to the new python file.
    https://codereview.qt-project.org/cat/95516,2,share/qtcreator/debugger/lldbbridge.py^0

    I didn't try to change the file line by line just made a backup of the original and put the new one in place.

    I hope it helps.

    Geza



  • Hi Geza...

    I had overwrite it the original file for this one and when I try to debbug my code the console say:

    @Debugging starts
    Debugging has finished@

    nothing happend and my program doesn't run ?

    I'm using qt5.3.2

    sory for ask again



  • Hi,

    I double checked for you. Downloaded the file from the link I gave you above (the direct download link). I went and replace my /Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py file and presto it works.

    So it is def the file I have used. I would happily help but i am so new to this : ) I can't think of anything else ... All I can say it works for me.

    Geza



  • Thank you my friend, now it's work for me

    best regards



  • Magic :))


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.