[Qt-creator] Remote GDB debugging.

Tim Hutt tdhutt at gmail.com
Tue Jun 17 10:57:22 CEST 2014


It didn't even get to the debugger bit - it happens as soon as I click the
debug button. However I totally lucked out and found the problem on the
first totally random thing I tried! I just disabled QML debugging in the
run configuration and the weird empty dialog went away completely.

GDB now runs, and the data-directory thing seems to be handled
automatically however it's still trying to run the executable as a local
file rather than connect to the remote server (which never receives a
connection).

Here are the commands it runs (paths changed to protect the innocent):

1show version
2show debug-file-directory
3set print object on
4set breakpoint pending on
5set print elements 10000
6handle SIGSEGV nopass stop print
7set unwindonsignal on
8set width 0
9set height 0
10-interpreter-exec console "set auto-solib-add on"
11-interpreter-exec console "python sys.path.insert(1,
'C:/Qt/Qt5.3.0/Tools/QtCreator/share/qtcreator/debugger/')"
12-interpreter-exec console "python
sys.path.append('C:/Users/thutt/Docs/Code/nRF51/qtcreator-gdb-7.7.1-mingw32_nt-6.1-i686/data-directory/python')"
13-interpreter-exec console "python from gdbbridge import *"
14-interpreter-exec console "set target-async off"
15-file-exec-and-symbols
"C:/Users/thutt/Docs/ProjectDir/Build/qtc_nRF51822-debug/myfirmware.out"
16-break-insert  -f "\"main.cpp\":51"
17-exec-run
18-gdb-exit

And the output:

dATTEMPT SYNC

sStarting debugger "GdbEngine" for ABI "x86-windows-msys-pe-32bit"...
dStart parameters: 'Run
C:\Users\thutt\Docs\ProjectDir\Build\qtc_nRF51822-debug\myfirmware.out'
mode: 1
dABI: x86-windows-msys-pe-32bit
dLanguages: c++
dExecutable:
C:\Users\thutt\Docs\ProjectDir\Build\qtc_nRF51822-debug\myfirmware.out
dDirectory: C:\Users\thutt\Docs\ProjectDir\Build
dDebugger:
C:\Users\thutt\Docs\Code\nRF51\qtcreator-gdb-7.7.1-mingw32_nt-6.1-i686\gdb-arm-none-eabi.exe
dProject: C:\Users\thutt\Docs\ProjectDir (built:
C:\Users\thutt\Docs\ProjectDir\Build)
dQML server: 127.0.0.1:3768
dRemote: localhost:2331
dSysroot:
dDebug Source Location:
dDebugger settings:
dBreakOnCatch: false  (default: false)
dBreakOnWarning: false  (default: false)
dSelectedPluginBreakpointsPattern: .*  (default: .*)
dBreakOnThrow: false  (default: false)
dAlwaysAdjustRegistersColumnWidths: false  (default: false)
dAlwaysAdjustSnapshotsColumnWidths: false  (default: false)
dBreakOnFatal: false  (default: false)
dBreakOnAbort: false  (default: false)
dShowQmlObjectTree: true  (default: true)
dQmlInspector.ShowAppOnTop: false  (default: false)
dAlwaysAdjustThreadsColumnWidths: false  (default: false)
dAlwaysAdjustModulesColumnWidths: false  (default: false)
dQmlInspector.FromQml: false  (default: false)
dShowQtNamespace: true  (default: true)
dSortStructMembers: true  (default: true)
dAlwaysAdjustStackColumnWidths: false  (default: false)
dShowStandardNamespace: true  (default: true)
dMaximalStringLength: 10000  (default: 10000)
dListSourceFiles: false  (default: false)
dAutoDerefPointers: true  (default: true)
dAlwaysAdjustLocalsColumnWidths: false  (default: false)
dAllPluginBreakpoints: true  (default: true)
dSkipKnownFrames: false  (default: false)
dEnableReverseDebugging: false  (default: false)
dAlwaysAdjustBreakpointsColumnWidths: false  (default: false)
dNoPluginBreakpoints: false  (default: false)
dSelectedPluginBreakpoints: false  (default: false)
dAdjustBreakpointLocations: true  (default: true)
dGdbStartupCommands:   (default: )
dGdbCustomDumperCommands:   (default: )
dLoadGdbDumpers: true  (default: true)
dAttemptQuickStart: false  (default: false)
dAutoEnrichParameters: true  (default: true)
dUseDynamicType: true  (default: true)
dGdbPostAttachCommands:   (default: )
dWatchdogTimeout: 20  (default: 20)
dMultiInferior: false  (default: false)
dIntelFlavor: false  (default: false)
dTargetAsync: false  (default: false)
dWarnOnReleaseBuilds: true  (default: true)
dIdentifyDebugInfoPackages: false  (default: false)
dMaximalStackDepth: 20  (default: 20)
dUseToolTipsInBreakpointsView: false  (default: false)
dUseToolTipsInBreakpointsView: false  (default: true)  ***
dUseToolTips: false  (default: true)  ***
dUseToolTipsInLocalsView: false  (default: false)
dRegisterForPostMortem: false  (default: false)
dAdditionalArguments:   (default: )
dUseAddressInBreakpointsView: false  (default: false)
dUseAddressInStackView: false  (default: false)
dBreakEvent:   (default: )
dBreakOnCrtDbgReport: false  (default: false)
dSymbolPaths:   (default: )
dSourcePaths:   (default: )
dIgnoreFirstChanceAccessViolation: false  (default: false)
dLoadGdbInit: true  (default: true)
dCDB_Console: false  (default: false)
dBreakpointCorrection: true  (default: true)
dFontSizeFollowsEditor: false  (default: false)
dUseMessageBoxForSignals: true  (default: true)
dUseAlternatingRowColours: false  (default: false)
dLogTimeStamps: false  (default: false)
dVerboseLog: false  (default: false)
dAutoQuit: false  (default: false)
dSwitchModeOnExit: false  (default: false)
dBreakpointsFullPath: false  (default: false)
dCloseBuffersOnExit: false  (default: false)
dUseCodeModel: true  (default: true)
dShowThreadNames: false  (default: false)
dRaiseOnInterrupt: true  (default: true)
dUseDebuggingHelper: true  (default: true)
dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
dQUEUE: SETUP ENGINE
dCALL: SETUP ENGINE
dTRYING TO START ADAPTER
dENABLING TEST CASE: 0
dSTARTING
C:/Users/thutt/Docs/Code/nRF51/qtcreator-gdb-7.7.1-mingw32_nt-6.1-i686/gdb-arm-none-eabi.exe
-i mi --tty=\\.\pipe\creator-8188-10601
dGDB STARTED, INITIALIZING IT
<1show version
<2show debug-file-directory
<3set print object on
<4set breakpoint pending on
<5set print elements 10000
<6handle SIGSEGV nopass stop print
<7set unwindonsignal on
<8set width 0
<9set height 0
sSetting up inferior...
<10-interpreter-exec console "set auto-solib-add on"
<11-interpreter-exec console "python sys.path.insert(1,
'C:/Qt/Qt5.3.0/Tools/QtCreator/share/qtcreator/debugger/')"
<12-interpreter-exec console "python
sys.path.append('C:/Users/thutt/Docs/Code/nRF51/qtcreator-gdb-7.7.1-mingw32_nt-6.1-i686/data-directory/python')"
<13-interpreter-exec console "python from gdbbridge import *"

dUNEXPECTED GDB STDERR: Python Exception <type 'exceptions.ImportError'> No
module named gdb:
dUNEXPECTED GDB STDERR:
d
dwarning:
dCould not load the Python gdb module from `c:\usr\local\share\gdb/python'.
dLimited Python support is available from the _gdb module.
dSuggest passing --data-directory=/path/to/gdb/data-directory.
d
>=thread-group-added,id="i1"
>~"GNU gdb (GDB) 7.7.1\n"
>~"Copyright (C) 2014 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to
change and redistribute it.\nThere is NO WARRANTY, to the extent permitted
by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"--host=i686-pc-mingw32
--target=arm-none-eabi\".\nType \"show configuration\" for configuration
details."
>~"\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>~"Find the GDB manual and other documentation resources online at:\n<
http://www.gnu.org/software/gdb/documentation/>.\n"
>~"For help, type \"help\".\n"
>~"Type \"apropos word\" to search for commands related to \"word\".\n"

>&"show version\n"
>~"GNU gdb (GDB) 7.7.1\n"
>~"Copyright (C) 2014 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to
change and redistribute it.\nThere is NO WARRANTY, to the extent permitted
by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"--host=i686-pc-mingw32
--target=arm-none-eabi\".\nType \"show configuration\" for configuration
details."
>~"\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>~"Find the GDB manual and other documentation resources online at:\n<
http://www.gnu.org/software/gdb/documentation/>.\n"
>~"For help, type \"help\".\n"
>~"Type \"apropos word\" to search for commands related to \"word\".\n"
>1^done
dPARSING VERSION: 1^done
dSUPPORTED GDB VERSION GNU gdb (GDB) 7.7.1
dCopyright (C) 2014 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law.  Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "--host=i686-pc-mingw32 --target=arm-none-eabi".
dType "show configuration" for configuration details.
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
dFind the GDB manual and other documentation resources online at:
d<http://www.gnu.org/software/gdb/documentation/>.
dFor help, type "help".
dType "apropos word" to search for commands related to "word".
dGNU gdb (GDB) 7.7.1
dCopyright (C) 2014 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law.  Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "--host=i686-pc-mingw32 --target=arm-none-eabi".
dType "show configuration" for configuration details.
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
dFind the GDB manual and other documentation resources online at:
d<http://www.gnu.org/software/gdb/documentation/>.
dFor help, type "help".
dType "apropos word" to search for commands related to "word".
dUSING GDB VERSION: 70701, BUILD: 2014
<14-interpreter-exec console "set target-async off"

>&"show debug-file-directory\n"
>~"The directory where separate debug symbols are searched for is \"\".\n"
>2^done

>&"set print object on\n"
>=cmd-param-changed,param="print object",value="on"
>3^done

>&"set breakpoint pending on\n"
>=cmd-param-changed,param="breakpoint pending",value="on"
>4^done

>&"set print elements 10000\n"
>=cmd-param-changed,param="print elements",value="10000"
>5^done

>&"handle SIGSEGV nopass stop print\n"
>~"Signal        Stop\tPrint\tPass to program\tDescription\n"
>~"SIGSEGV       Yes\tYes\tNo\t\tSegmentation fault\n"
>6^done

>&"set unwindonsignal on\n"
>=cmd-param-changed,param="unwindonsignal",value="on"
>7^done

>&"set width 0\n"
>=cmd-param-changed,param="width",value="4294967295"
>8^done

>&"set height 0\n"
>9^done

>10^done

>11^done

>12^done


>~"dumpers=[{type=\"Core__Id\",formats=\"\"},{type=\"CPlusPlus__Identifier\",formats=\"\"},{type=\"std__stack\",formats=\"\"},{type=\"QDir\",formats=\"\"},{type=\"QSharedData\",formats=\"\"},{type=\"Debugger__Internal__GdbMi\",formats=\"\"},{type=\"boost__container__list\",formats=\"\"},{type=\"Utils__FileName\",formats=\"\"},{type=\"std__deque\",formats=\"\"},{type=\"QFixed\",formats=\"\"},{type=\"uint8_t\",formats=\"\"},{type=\"std____debug__stack\",formats=\"\"},{type=\"QPoint\",formats=\"\"},{type=\"std____1__vector\",formats=\"\"},{type=\"QMultiMap\",formats=\"Normal,Compact\"},{type=\"QModelIndex\",formats=\"Normal,Enhanced\"},{type=\"QLocale\",formats=\"\"},{type=\"std__set__const_iterator\",formats=\"\"},{type=\"string\",formats=\"\",editable=\"true\"},{type=\"std__set\",formats=\"\"},{type=\"std__unique_ptr\",formats=\"\"},{type=\"QFile\",formats=\"\"},{type=\"wstring\",formats=\"\"},{type=\"QByteArrayData\",formats=\"\"},{type=\"QSizeF\",formats=\"\"},{type=\"std____1__string\",formats=\"\"},{type=\"QIPv6Address\",formats=\"\"},{type=\"Debugger__Internal__ThreadId\",formats=\"\"},{type=\"Utils__ElfSection\",formats=\"\"},{type=\"QMap\",formats=\"Normal,Compact\"},{type=\"std__deque__QNX\",formats=\"\"},{type=\"QChar\",formats=\"\"},{type=\"CPlusPlus__TemplateNameId\",formats=\"\"},{type=\"QScriptValue\",formats=\"\"},{type=\"QMetaObject\",formats=\"\"},{type=\"QHostAddress\",formats=\"\"},{type=\"QV4__Value\",formats=\"\"},{type=\"std__string\",formats=\"Inline,In
Separate
Window\",editable=\"true\"},{type=\"boost__posix_time__time_duration\",formats=\"\"},{type=\"std____1__shared_ptr\",formats=\"\"},{type=\"CPlusPlus__Internal__Value\",formats=\"\"},{type=\"QFileInfo\",formats=\"\"},{type=\"QHash__const_iterator\",formats=\"\"},{type=\"std____debug__vector\",formats=\"Normal\"},{type=\"Debugger__Internal__WatchData\",formats=\"\"},{type=\"QTime\",formats=\"\"},{type=\"std___Rb_tree_const_iterator\",formats=\"\"},{type=\"QTimeZone\",formats=\"\"},{type=\"boost__bimaps__bimap\",formats=\"\"},{type=\"QV4__TypedValue\",formats=\"\"},{type=\"std____cxx1998__map\",formats=\"\"},{type=\"QHash\",formats=\"Normal,Compact\"},{type=\"QXmlAttributes\",formats=\"\"},{type=\"std__array\",formats=\"Normal\"},{type=\"QLinkedList\",formats=\"\"},{type=\"QStack\",formats=\"Normal\"},{type=\"CPlusPlus__Token\",formats=\"\"},{type=\"std__list__QNX\",formats=\"\"},{type=\"__m128i\",formats=\"\"},{type=\"KDSoapValue1\",formats=\"\"},{type=\"std____1__basic_string\",formats=\"\"},{type=\"std____1__unique_ptr\",formats=\"\"},{type=\"std__stringHelper1\",formats=\"\"},{type=\"std__map__iterator\",formats=\"\"},{type=\"QDate\",formats=\"\"},{type=\"std__unordered_map\",formats=\"Normal,Compact\"},{type=\"__m128d\",formats=\"\"},{type=\"QTextCodec\",formats=\"\"},{type=\"std__shared_ptr\",formats=\"\"},{type=\"Debugger__Internal__WatchItem\",formats=\"\"},{type=\"std__unordered_set\",formats=\"\"},{type=\"QMetaObjectPrivate\",formats=\"\"},{type=\"QByteArray\",formats=\"Inline,As
Latin1 in Separate Window,As UTF-8 in Separate
Window\"},{type=\"std____cxx1998__set\",formats=\"\"},{type=\"QPixmap\",formats=\"\"},{type=\"__m256\",formats=\"\"},{type=\"std__map\",formats=\"Normal,Compact\"},{type=\"boost__posix_time__ptime\",formats=\"\"},{type=\"QTemporaryFile\",formats=\"\"},{type=\"Eigen__Matrix\",formats=\"\"},{type=\"QImage\",formats=\"Normal,Displayed\"},{type=\"QSet\",formats=\"\"},{type=\"std__map__const_iterator\",formats=\"\"},{type=\"QAbstractItemModel\",formats=\"Normal,Enhanced\"},{type=\"QFiniteStack\",formats=\"Normal\"},{type=\"std__set__iterator\",formats=\"\"},{type=\"QTextDocument\",formats=\"\"},{type=\"QTJSC__JSValue\",formats=\"\"},{type=\"__gnu_cxx__hash_set\",formats=\"\"},{type=\"QRegion\",formats=\"\"},{type=\"std__wstring\",formats=\"\"},{type=\"std____1__unordered_set\",formats=\"\"},{type=\"QBasicAtomicInt\",formats=\"\"},{type=\"std____debug__set\",formats=\"\"},{type=\"QDateTime\",formats=\"\"},{type=\"boost__gregorian__date\",formats=\"\"},{type=\"std__set__QNX\",formats=\"\"},{type=\"CPlusPlus__ByteArrayRef\",formats=\"\"},{type=\"boost__shared_ptr\",formats=\"\"},{type=\"std__basic_string\",formats=\"\"},{type=\"std__map__QNX\",formats=\"\"},{type=\"__m256d\",formats=\"\"},{type=\"std__stringHelper1__QNX\",formats=\"\"},{type=\"__m256i\",formats=\"\"},{type=\"QRectF\",formats=\"\"},{type=\"std__complex\",formats=\"\"},{type=\"QAtomicInt\",formats=\"\"},{type=\"int8_t\",formats=\"\"},{type=\"CPlusPlus__StringLiteral\",formats=\"\"},{type=\"boost__optional\",formats=\"\"},{type=\"std__vector__QNX\",formats=\"\"},{type=\"std____1__unordered_map\",formats=\"Normal,Compact\"},{type=\"Debugger__Internal__BreakpointModelId\",formats=\"\"},{type=\"QStringRef\",formats=\"\"},{type=\"std____debug__map\",formats=\"\"},{type=\"std____debug__list\",formats=\"\"},{type=\"QString\",formats=\"Inline,Separate
Window\",editable=\"true\"},{type=\"QSize\",formats=\"\"},{type=\"std____debug__deque\",formats=\"\"},{type=\"QSharedDataPointer\",formats=\"\"},{type=\"QStringList\",formats=\"\"},{type=\"std___Rb_tree_iterator\",formats=\"\"},{type=\"QRegExp\",formats=\"\"},{type=\"std__vector\",formats=\"Normal\",editable=\"true\"},{type=\"QFlags\",formats=\"\"},{type=\"QTextCursor\",formats=\"\"},{type=\"std____debug__unordered_map\",formats=\"Normal,Compact\"},{type=\"QList\",formats=\"Assume
Direct Storage,Assume Indirect
Storage\"},{type=\"QStandardItem\",formats=\"\"},{type=\"std____debug__unordered_set\",formats=\"\"},{type=\"QSharedPointer\",formats=\"\"},{type=\"QUrl\",formats=\"Inline,Separate
Window\"},{type=\"std__list\",formats=\"\"},{type=\"QScopedPointer\",formats=\"\"},{type=\"CPlusPlus__Literal\",formats=\"\"},{type=\"QMapNode\",formats=\"\"},{type=\"std____1__array\",formats=\"Normal\"},{type=\"QVariant\",formats=\"\"},{type=\"QV4__String\",formats=\"\"},{type=\"QVector\",formats=\"Normal\",editable=\"true\"},{type=\"std____1__wstring\",formats=\"\"},{type=\"QWeakPointer\",formats=\"\"},{type=\"__m128\",formats=\"\"},{type=\"QPointF\",formats=\"\"},{type=\"KDSoapValue\",formats=\"\"},{type=\"QRect\",formats=\"\"},{type=\"CPlusPlus__IntegerType\",formats=\"\"},{type=\"QHash__iterator\",formats=\"\"},{type=\"__gnu_debug___Safe_iterator\",formats=\"\"},{type=\"CPlusPlus__Internal__PPToken\",formats=\"\"},{type=\"QHashNode\",formats=\"\"},{type=\"QAtomicPointer\",formats=\"\"},{type=\"CPlusPlus__NamedType\",formats=\"\"},]\n"
>13^done
dENGINE SUCCESSFULLY STARTED
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

>14^done

dCALL: SETUP INFERIOR
<15-file-exec-and-symbols
"C:/Users/thutt/Docs/ProjectDir/Build/qtc_nRF51822-debug/myfirmware.out"

>15^done
sSetting breakpoints...
dSetting breakpoints...
dATTEMPT BREAKPOINT SYNCHRONIZATION
dTAKING OWNERSHIP OF BREAKPOINT 1 IN STATE 0
<16-break-insert  -f "\"main.cpp\":51"
dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED

dATTEMPT SYNC
dATTEMPT BREAKPOINT SYNCHRONIZATION
dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED
>16^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000145d6",func="serialTest()",file="C:/Users/thutt/Docs/ProjectDir/main.cpp",fullname="C:\\Users\\thutt\\Docs\\ProjectDir\\main.cpp",line="51",thread-groups=["i1"],times="0",original-location="main.cpp:51"}
dATTEMPT BREAKPOINT SYNCHRONIZATION
dBREAKPOINTS ARE SYNCHRONIZED
dALL COMMANDS DONE; INVOKING CALLBACK
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
<17-exec-run

>17^error,msg="Don't know how to run.  Try \"help target\"."
dDon't know how to run.  Try "help target".
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

dCALL: SHUTDOWN ENGINE
dPLAIN ADAPTER SHUTDOWN 20
dINITIATE GDBENGINE SHUTDOWN IN STATE 0, PROC: 2
<18-gdb-exit

>18^exit
dGDB CLAIMS EXIT; WAITING
dGDB PROCESS FINISHED, status 0, code 0
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.



On 17 June 2014 09:23, Poenitz Andre <Andre.Poenitz at digia.com> wrote:

> Tim Hutt [tdhutt at gmail.com]
> > So this is just a QtCreator problem.
>
> Can you attach the debugger log?
>
> Andre'
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140617/1ea9fac4/attachment.html>


More information about the Qt-creator mailing list