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

Qt Creator IDE: Debugger at Wrong line



  • I'm developing a Qt C++ application and writing my own Fortran static library.

    Using "debug mode" I can ran line by line of my C++ code. Until here, all Ok!
    So, in the middle of my C++ code I have a call of my Fortran subroutine called f_analysis_x().

    My problems are:

    1- When the Qt Creator IDE debugger enter inside the Fortran code, the "debugger arrow" goes in a lot wrong line positions.
    Look this image below: in this example, the line 79 is a blank space but the debugger arrow goes there!

    2- Some Fortran variables are listed in the Qt Debugger, but some others are not! Why?
    In the image below: I have a "job_id" integer (listed ok), but "job_id_str" string (is not listed!)

    3- Looking at Qt Creator variables debugger list, inside the Fortran source-code, some Fortran variables listed do not update their values in this Qt debugger list when they are modifyied by the Fortran source-code. Specially strings. Why?
    In the image below: you can see an example of this in the variables: "PROJECT_PATH" and "RESULTS_PATH"

    0_1568727383297_debugger.jpg

    My system is:

    • Qt Creator IDE 4.10.0
    • Windows 10 x64
    • Intel Visual Fortran 2019 (Visual Studio 2019)


  • About my 3 questions above, I solved 2 of them:

    1- I was NOT copying the updated Fortran Static library to my Qt Project...so the Qt Debugger arrow was pointed to the old line numbers and in "wrong" position. My fault!

    2- The same mistake was unable to Qt Debugger variable list shows me the new added Fortran variables...my fault!

    Please, look this image below:
    0_1568731665928_debugger2.jpg

    In red:
    I have to copy the job_id input argument (intent in) to a new Fortran variable called id just to see it on Qt Debugger.

    In Blue:
    You can see the result of the "red code"

    In Orange:
    All strings that I declared in my Fortran source-code that are not showing up his values in Qt Creator IDE debugger.

    But my 3 question still alive:
    Now I saw that the most variables (not only) that Qt Creator debugger are not showing the values are the Fortran INTENT(IN) parameters.
    Speaking in C++: this variables are input function parameters/arguments.

    From C++, I called my f_analysis_x() Fortran subroutine passing 2 input arguments:

    • const char* project_str (passing by reference)
    • const int job_id (passing by value)

    So I have f_analysis_x(project_str, job_id).

    In my Fortran source-code, this input arguments are declared in this way:

    ! Enable C types:
    use ISO_C_BINDING
    
    character(kind=C_CHAR), target, intent(in) :: project_path(*)
    integer(kind=C_INT), intent(in), value :: job_id
    

    Using Microsoft Visual Studio with Intel Visual Fortran I can saw all input arguments in MSVC++ debugger. Why I can see those input arguments using Qt Creator IDE?

    Look, one of this arguments is passed by value (is not a pointer)!


Log in to reply