Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt debugger helpers and MSVC



  • Hello.
    I have the following set of software installed on Windows 10 x64:

    • Qt Creator 4.5.0
    • MinGW 5.3.0 (as a part of Qt Creator installation)
    • Microsoft visual studio 2015 (both x86 and x64 compilers)
    • Widows SDK, that has cdb 10.0.16299.15 (both x86 and x64)

    The problem is, I can't see any value of Qt variables (like QString) in the debugger, when using Microsoft tools.
    I've checked the debugger helper library:

    • c:\Qt\Qt5.10.0\Tools\QtCreator\lib\qtcreatorcdbext32\qtcreatorcdbext.dll is loaded with cdb when debugging x32 application
    • c:\Qt\Qt5.10.0\Tools\QtCreator\lib\qtcreatorcdbext64\qtcreatorcdbext.dll is loaded with cdb when debugging x64 application

    However, while GDB shows the contents of QString (as well as std::string) in the debugger window, cdb fails to show QString contents (it prints <not accessible> instead).0_1536522229480_cdb-debug.png
    The image shows two variables of different types and the way they're shown while debugging x86 application, built with MSVC 2015 and debugged with x86 cdb.

    What should I do to fix this?

    P.S. I've tried to use Qt VS tools. This makes the debugger work fine, but Visual Studio itself is not very convenient when it comes to ui-based Qt development (and it's damn heavy comparing to Qt Creator).
    P.P.S. Don't be messed up by "/dev/ttyUSB0". This used to be a linux source code for a serial port application, but it is being built in Windows environment.


  • Lifetime Qt Champion

    Hi @umod.47,

    I found following report QTCREATORBUG-19797 in the bug tracker.

    That report also gives the hint that you need .pdb files to resolve the debug symbols. Something in that regard may be broken for you...

    Regards



  • @aha_1980
    I've seen this topic, and I have all the .pdb files available. I.e.: c:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin\Qt5Cored.pdb

    I've tried this solution as well:

    I encountered the same issue, but adding 'C:\Qt\5.7\msvc2013_64\bin' to the symbol paths in 'Settings/Debugger/CDB paths' fixed the issue.
    
    I experienced this in version 4.5.1 of the QtCreator.
    
    The type information of Qt classes was still found out of the box in 4.5.0 (without the entry mentioned above).
    
    

    My settings contain this in symbols path:

    C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin
    

    This folder DOES contain .pdb files. But cdb still won't show the contents of QString, QList or any else Qt-related class.


  • Lifetime Qt Champion

    @umod.47

    anything obvious in Windows > Views > Debugger Log?



  • @aha_1980 I guess you're talking about this log:

    
    sЗапускается отладчик «CdbEngine» для ABI «x86-windows-msvc2015-pe-32bit»...
    dStart parameters: 'serialpoke' mode: 1
    dABI: x86-windows-msvc2015-pe-32bit
    dLanguages: c++ 
    dExecutable: C:\_progs\build-serialpoke-Desktop_Qt_5_10_0_MSVC2015_32bit-Debug\debug\serialpoke.exe 
    dDirectory: C:\_progs\build-serialpoke-Desktop_Qt_5_10_0_MSVC2015_32bit-Debug
    dDebugger: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe
    dProject: C:\_progs\serialpoke
    dAdditional Search Directories:
    dSysroot: 
    dDebug Source Location: 
    dDebugger settings:
    dAdditionalArguments:   (default: )
    dAdjustBreakpointLocations: true  (default: true)
    dAllPluginBreakpoints: true  (default: true)
    dAlwaysAdjustColumnWidths: true  (default: true)
    dAutoDerefPointers: true  (default: true)
    dAutoEnrichParameters: true  (default: true)
    dAutoQuit: false  (default: false)
    dBreakEvent:   (default: )
    dBreakOnAbort: true  (default: false)  ***
    dBreakOnCatch: false  (default: false)
    dBreakOnCrtDbgReport: false  (default: false)
    dBreakOnFatal: true  (default: false)  ***
    dBreakOnThrow: false  (default: false)
    dBreakOnWarning: false  (default: false)
    dBreakpointCorrection: true  (default: true)
    dBreakpointsFullPath: false  (default: false)
    dCDB_Console: false  (default: false)
    dCloseBuffersOnExit: false  (default: false)
    dCloseMemoryBuffersOnExit: true  (default: true)
    dDisplayStringLimit: 100  (default: 100)
    dEnableReverseDebugging: false  (default: false)
    dExtraDumperFile: C:/Qt/Qt5.10.0/Tools/QtCreator/share/qtcreator/debugger/qttypes.py  (default: )  ***
    dFontSizeFollowsEditor: false  (default: false)
    dGdbCustomDumperCommands:   (default: )
    dGdbPostAttachCommands:   (default: )
    dGdbStartupCommands:   (default: )
    dIdentifyDebugInfoPackages: false  (default: false)
    dIgnoreFirstChanceAccessViolation: false  (default: false)
    dIntelFlavor: false  (default: false)
    dLoadGdbDumpers2: false  (default: false)
    dLoadGdbInit: true  (default: true)
    dLogTimeStamps: false  (default: false)
    dMaximalStackDepth: 20  (default: 20)
    dMaximalStringLength: 10000  (default: 10000)
    dMultiInferior: false  (default: false)
    dNoPluginBreakpoints: false  (default: false)
    dQmlInspector.ShowAppOnTop: false  (default: false)
    dRaiseOnInterrupt: true  (default: true)
    dRegisterForPostMortem: false  (default: false)
    dSelectedPluginBreakpoints: false  (default: false)
    dSelectedPluginBreakpointsPattern: .*  (default: .*)
    dShowQObjectNames2: true  (default: true)
    dShowQmlObjectTree: true  (default: true)
    dShowQtNamespace: true  (default: true)
    dShowStandardNamespace: true  (default: true)
    dShowThreadNames: true  (default: false)  ***
    dSkipKnownFrames: false  (default: false)
    dSortStructMembers: true  (default: true)
    dSourcePaths:   (default: )
    dStationaryEditorWhileStepping: false  (default: false)
    dSwitchModeOnExit: false  (default: false)
    dSymbolPaths:   (default: )
    dTargetAsync: false  (default: false)
    dUseAddressInBreakpointsView: false  (default: false)
    dUseAddressInStackView: false  (default: false)
    dUseAlternatingRowColours: false  (default: false)
    dUseCodeModel: true  (default: true)
    dUseDebuggingHelper: true  (default: true)
    dUseDynamicType: true  (default: true)
    dUseMessageBoxForSignals: true  (default: true)
    dUsePythonDumper: true  (default: true)
    dUseToolTips: false  (default: true)  ***
    dUseToolTipsInBreakpointsView: false  (default: false)
    dUseToolTipsInBreakpointsView: false  (default: true)  ***
    dUseToolTipsInLocalsView: false  (default: false)
    dWarnOnReleaseBuilds: true  (default: true)
    dWatchdogTimeout: 20  (default: 20)
    dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
    dCALL: SETUP ENGINE
     Launching C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe -aqtcreatorcdbext.dll -lines -G -c .idle_cmd !qtcreatorcdbext.idle -y cache*C:\Users\umod.47\AppData\Local\Temp\QtCreator-hXylJf\symbolcache;srv*http://msdl.microsoft.com/download/symbols;C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin C:\_progs\build-serialpoke-Desktop_Qt_5_10_0_MSVC2015_32bit-Debug\debug\serialpoke.exe
     using C:\Qt\Qt5.10.0\Tools\QtCreator\lib\qtcreatorcdbext32\qtcreatorcdbext.dll of 27.03.2018 15:30.
     C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe running as 15868
    
     Microsoft (R) Windows Debugger Version 10.0.16299.15 X86
     Using CDB based breakpoint correction.
     Copyright (c) Microsoft Corporation. All rights reserved.
     CommandLine: C:\_progs\build-serialpoke-Desktop_Qt_5_10_0_MSVC2015_32bit-Debug\debug\serialpoke.exe
    
     ************* Path validation summary **************
     Response                         Time (ms)     Location
     Deferred                                       cache*C:\Users\umod.47\AppData\Local\Temp\QtCreator-hXylJf\symbolcache
     Deferred                                       srv*http://msdl.microsoft.com/download/symbols
     OK                                             C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin
     Symbol search path is: cache*C:\Users\umod.47\AppData\Local\Temp\QtCreator-hXylJf\symbolcache;srv*http://msdl.microsoft.com/download/symbols;C:\Qt\Qt5.10.0\5.10.0\msvc2015_64\bin
     Executable search path is: 
    sЗагружен модуль: serialpoke.exe
    sЗагружен модуль: ntdll.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\KERNEL32.DLL
    sЗагружен модуль: C:\WINDOWS\SysWOW64\KERNELBASE.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\SHELL32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\msvcrt.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\cfgmgr32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\ucrtbase.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\shcore.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\RPCRT4.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\SspiCli.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\CRYPTBASE.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\bcryptPrimitives.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\sechost.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\combase.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\windows.storage.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\advapi32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\shlwapi.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\GDI32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\gdi32full.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\msvcp_win.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\USER32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\win32u.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\kernel.appcore.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\profapi.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\powrprof.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\FLTLIB.DLL
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Cored.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\WS2_32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\ole32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\MSVCP140D.dll
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5SerialPortd.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\VCRUNTIME140D.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\ucrtbased.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\SETUPAPI.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\NETAPI32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\MPR.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\USERENV.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\VERSION.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\WINMM.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\WINMMBASE.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\SRVCLI.DLL
    sЗагружен модуль: C:\WINDOWS\SysWOW64\NETUTILS.DLL
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Widgetsd.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\UxTheme.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\dwmapi.dll
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Guid.dll
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Guid.dll
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Guid.dll
     (37a4.28fc): Break instruction exception - code 80000003 (first chance)
    
     eax=00000000 ebx=00000000 ecx=a89a0000 edx=00000000 esi=00554000 edi=775ad724
     eip=77648079 esp=0021f7fc ebp=0021f828 iopl=0         nv up ei pl zr na pe nc
     cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
     ntdll!LdrpDoDebuggerBreak+0x2b:
     77648079 cc              int     3
     cdb: Reading initial command '.idle_cmd !qtcreatorcdbext.idle'
     Execute when idle: !qtcreatorcdbext.idle
     0:000>
    <l+t
    <l+s
    dNOTE: ENGINE SETUP OK
    dState changed from EngineSetupRequested(1) to EngineSetupOk(3) [master]
    dCALL: SETUP INFERIOR
    dState changed from EngineSetupOk(3) to InferiorSetupRequested(4) [master]
    <bu100100 `serialpoke!C:\_progs\serialpoke\mainwindow.cpp:13`
    <!qtcreatorcdbext.breakpoints -v
    <sxn 0x4000001f
    <sxn ibp
    <.asm source_line
    <!qtcreatorcdbext.setparameter maxStringLength=10000 maxStackDepth=20
    <!qtcreatorcdbext.script  print(sys.version)
    <!qtcreatorcdbext.pid
     Source options are 1:
          1/t - Step/trace by source line
     Source options are 5:
          1/t - Step/trace by source line
          4/s - List source code at prompt
     *** WARNING: Unable to verify checksum for serialpoke.exe
    d*** WARNING: Unable to verify checksum for serialpoke.exe
     Obtained breakpoint 0x10fd3cc (#1), at 0x3d2880, module: 'serialpoke'
     All breakpoints have been resolved.
     Assembly options: source_line
     3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]
    <!qtcreatorcdbext.script  sys.path.insert(1, 'C:\\Qt\\Qt5.10.0\\Tools\\QtCreator\\share\\qtcreator\\debugger')
    <!qtcreatorcdbext.script  from cdbbridge import Dumper
    <!qtcreatorcdbext.script  print(dir())
    <!qtcreatorcdbext.script  theDumper = Dumper()
    <!qtcreatorcdbext.script  theDumper.loadDumpers(None)
    <!qtcreatorcdbext.script  theDumper.addDumperModule({"path":"C:/Qt/Qt5.10.0/Tools/QtCreator/share/qtcreator/debugger/qttypes.py"})
     Qt Creator CDB extension version 4.3 32 bit.
    dПолучено уведомление от pid 14244
    dNOTE: INFERIOR SETUP OK
    dState changed from InferiorSetupRequested(4) to InferiorSetupOk(6) [master]
    dState changed from InferiorSetupOk(6) to EngineRunRequested(7) [master]
    dCALL: RUN ENGINE
    <g
     ['Dumper', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'cdbext', 'sys']
    dNOTE: ENGINE RUN AND INFERIOR RUN OK
    sВыполняется.
    dState changed from EngineRunRequested(7) to InferiorRunOk(11) [master]
    sЗагружен модуль: C:\WINDOWS\SysWOW64\IMM32.DLL
    
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\plugins\platforms\qwindowsd.dll
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\plugins\platforms\qwindowsd.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\OLEAUT32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\wintab32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\HID.DLL
    sЗагружен модуль: C:\WINDOWS\SysWOW64\WTSAPI32.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\ISD_Tablet.dll
    
     *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\SysWOW64\wintab32.dll - 
    sЗагружен модуль: C:\Qt\Qt5.10.0\5.10.0\msvc2015\plugins\styles\qwindowsvistastyled.dll
    sЗагружен модуль: C:\WINDOWS\SysWOW64\dwrite.dll
    
     Breakpoint 100100 hit
     eax=0021fc18 ebx=00554000 ecx=f8aa4291 edx=00000008 esi=003d134d edi=003d134d
     eip=003d2880 esp=0021fc04 ebp=0021fc5c iopl=0         nv up ei pl nz na po nc
     cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00200202
     >   13:     ui->log_edit->document()->setMaximumBlockCount(1000);
     serialpoke!MainWindow::MainWindow+0x110:
        13 003d2880 68e8030000      push    3E8h
    sОстановлено на точке останова 1 (1), поток 0.
    dNOTE: INFERIOR SPONTANEOUS STOP
    sОстановлено.
    dState changed from InferiorRunOk(11) to InferiorStopOk(14) [master]
    <.frame 0x0
    <!qtcreatorcdbext.script  theDumper.fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["local","watch","inspect","return"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":1,"stringcutoff":"10000","typeformats":{},"uninitialized":[],"watchers":[]})
     00 0021fc5c 003d26dc serialpoke!MainWindow::MainWindow+0x110 [c:\_progs\serialpoke\mainwindow.cpp @ 13]
    
     *** WARNING: Unable to verify checksum for C:\Qt\Qt5.10.0\5.10.0\msvc2015\bin\Qt5Cored.dll
    
     result={data=[{iname="local.parent",name="parent",origaddr="0x21fc64",address="0x0",numchild="0",type="QWidget*",value="0x0"},{iname="local.qs",name="qs",numchild="0",type="QString",valueencoded="notaccessible",value=""},{iname="local.s",name="s",numchild="12",address="0x21fc30",type="std::basic_string<char,std::char_traits<char>,std::allocator<char> >",valueencoded="utf8",value="2F6465762F74747955534230"},{iname="local.this",name="this",origaddr="0x21fc2c",address="0x21fc6c",address="0x21fc6c",numchild="1",type="MainWindow",value=""}],partial="0",timings=[]}
     <Rebuild Watchmodel 1 @ 14:15:35.394 >
    sЗакончено получение данных
    
    

    I see Qt Creator uses Python to display types information. cdb.exe loads up qtcreatorcdbext.dll and python35.dll from the correct folder (i.e. c:\Qt\Qt5.10.0\Tools\QtCreator\lib\qtcreatorcdbext64 for 64-bit applications).
    I have this version of Python installed at c:\Python36:

    Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
    

    Can they interfere somehow?


  • Lifetime Qt Champion

    Hi @umod.47,

    Now that you mention Python - I remember some users had problems that went away when they disabled the Python dumpers in the Options - I'm not sure if it would help in your case.



  • @aha_1980
    I've installed Windows 10, MSVC2015, Qt Creator and Windows SDK in a virtual box machine. Everything works fine with Qt Creator 4.7.0.
    Then I've updated my native installation using Maintenace Tool. I've noticed, that somehow I had Qt Creator 4.5.0 and Qt Creator CDB debugger support 4.6.0
    Maybe version difference caused some trouble, but I still don't see a big difference between std::string and QString in terms of displaying values.

    Anyway, now everything works. Let's hope nothing else died in the process :)

    Thanks.


Log in to reply