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

Debugging Qt source in Netbeans 8.1: how to inspect QStrings etc?



  • Netbeans uses gdb to debug C++ code by default.
    This https://wiki.qt.io/IDE_Debug_Helpers describes how QStrings can be supported in several IDEs, but not in gdb/Netbeans.
    This recommends creating a macro file for gdb: https://zhjxue.wordpress.com/2009/03/14/how-to-show-value-of-qstring-in-gdb/
    And this speaks of supporting Qt5 QString differences (but not other classes): http://silmor.de/qtstuff.printqstring.php

    Would be nice if Qt could put out a guide for inspecting the Qt classes in gdb, which is a kind of popular debugger.



  • A somewhat related question:

    If I dump debug info using qDebug() to the Netbeans output window, it dumps w/o carriage return.
    The next line is offset to the end of the previous and everything looks like stairs running out into the right side of the screen.
    Should I append CR to every line or is there anything in configuration I should set up for CR to be added automatically?

    Looks like this:

    abc
       def
          ghi
             etc 
    


  • There is no option to globally change the end-of-line behaviour of qDebug.

    The missing interpretation of return of the carriage must be Netbeans doing. This does not happen in a normal terminal, nor in any other IDE I am aware of.



  • Looks like this is Netbeans thing indeed, as it treats OS output regarding it not being able to start the program the same way.


Log in to reply