Results 1 to 5 of 5

Thread: How to watch STL containers/iterators during debugging?

  1. #1
    Join Date
    Jun 2007
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to watch STL containers/iterators during debugging?

    Using Qt Creator 2.2 on WinXP 32-bit with MinGW toolchain supplied with Qt Creator. Currently it is not possible to see the values inside STL containers/iterators:

    Can anyone tell what is wrong with my setup? Thanks in advance.

  2. #2
    Join Date
    Jun 2007
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to watch STL containers/iterators during debugging?

    Nobody uses QtCreator on windows for debugging C++ sources?

    I'd like to switch from MSVC to QtCreator but no sense if debugging is not supported...

  3. #3
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to watch STL containers/iterators during debugging?

    Debugging is supported. Something's wrong here. Can you post the contents of the debugger log (right pane of Windows->Views->Debugger Log)

  4. #4
    Join Date
    Jun 2007
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to watch STL containers/iterators during debugging?

    Here is it:
    TEXT Code:
    1. 40show version
    2. 41set breakpoint pending on
    3. 42set print elements 10000
    4. 43set overload-resolution off
    5. 44handle SIGSEGV nopass stop print
    6. 45set unwindonsignal on
    7. 46pwd
    8. 47set width 0
    9. 48set height 0
    10. 49set auto-solib-add on
    11. 50-interpreter-exec console "maintenance set internal-warning quit no"
    12. 51-interpreter-exec console "maintenance set internal-error quit no"
    13. 52-interpreter-exec console "disassemble 0 0"
    14. 53-interpreter-exec console "python execfile('C:/Qt/qtcreator-2.2.0/share/qtcreator/gdbmacros/dumper.py')"
    15. 54-interpreter-exec console "python execfile('C:/Qt/qtcreator-2.2.0/share/qtcreator/gdbmacros/gdbmacros.py')"
    16. 55-interpreter-exec console "bbsetup"
    17. 56-file-exec-and-symbols "D:/Projects/QtCreator/TestDebug-build-desktop/debug/TestDebug.exe"
    18. 57set substitute-path C:/iwmake/build_mingw_opensource C:/Qt/4.7.2
    19. 58set substitute-path C:/ndk_buildrepos/qt-desktop/src C:/Qt/4.7.2
    20. 59set substitute-path C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt C:/Qt/4.7.2
    21. 60-break-insert -f "\"main.cpp\":18"
    22. 61info line *0x401a40
    23. 62maint print msymbols D:/Temp/gdb_ns_.gW3896
    24. 63-break-insert -f 'qFatal'
    25. 64-break-commands 2 return
    26. 65-exec-run
    27. 66info shared
    28. 67-break-list
    29. 68-stack-list-frames 0 20
    30. 69-thread-info
    31. 70-stack-select-frame 0
    32. 71bb options:fancy,autoderef vars: expanded: typeformats: formats: watchers:
    33. <Rebuild Watchmodel 6>
    34. 72bb options:fancy,autoderef,partial vars:local.m expanded:local.m typeformats: formats: watchers:
    35. <Rebuild Watchmodel 7>
    To copy to clipboard, switch view to plain text mode 

    And from the right panel:

    QtCreatorDebuggerLog.txt

  5. #5
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to watch STL containers/iterators during debugging?

    The issue seems to be gcc 4.4 creating insufficient debug information for the allocator template argument of std::map<Key, Value, Comp, Alloc>.

    Unfortunately, the code displaying the std::map relies on that.
    It looks like you have two options:
    (a) Use 4.5 or later.
    (b) Replace the use of the Allocator with something that has the same effect: Find the file share/qtcreator/gdbmacros/gdbmacros.py in your Creator installation. There should be a function 'qdump__std__map' around line 1800. In this function, replace the line 'pairType = templateArgument(templateArgument(item.value.type, 3), 0)' by 'pairType = templateArgument(impl.type, 1)'

Similar Threads

  1. Iterators v.s. index based for loops
    By pssss in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2011, 15:33
  2. Replies: 1
    Last Post: 24th July 2010, 18:23
  3. qDeleteAll() and linked list iterators
    By jkyle in forum Qt Programming
    Replies: 2
    Last Post: 29th June 2010, 23:18
  4. I can't watch anytning in my screen
    By maider in forum Qt Programming
    Replies: 13
    Last Post: 26th March 2010, 08:18
  5. QLinkedList and iterators
    By eu.x in forum Newbie
    Replies: 1
    Last Post: 19th April 2007, 20:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.