Debugging Issues with Fortran

Here you can discuss the universal Integrated Development Environment for OpenVMS
Post Reply

Topic author
cgoodwin
Contributor
Posts: 13
Joined: Wed Aug 21, 2019 8:43 am
Reputation: 0
Status: Offline

Debugging Issues with Fortran

Post by cgoodwin » Thu Sep 19, 2019 10:58 am

So I managed to get nearly all aspects of the VMS IDE setup for our systems, with the exception of debugging our Fortran code. It successfully runs our com file, which compiles and links the code into the exe and dbg files, then the command file copies those to the correct directory (project_root.out.debug). This all works correctly. I go to run the debugger and it comes up with warnings that the .lis file doesn't find for the source files. After that, it contnues as normal in the output window. I can step through my application at this point, but any break points I set on the code file aren't hit, and nothing is populated in the variables, watch, and call stack windows. I believe this has to do with those .lis files, however, I am having issues finding any documentation on them. Anyone have any ideas on what to do? Thanks for any help!

Output Window on Debug Attempt:

Code: Select all

Connected to the server
.LIS file doesn't find for the source file c:/my_file_path/my_source_code.FOR

.LIS file doesn't find for the source file c:/my_file_path/my_other_source_code.com

OpenVMS I64 Debug64 Version V8.4-000

CMD: display dbge AT q1 output
CMD: select /error dbge
CMD: set mode screen
CMD: display /remove src
CMD: set abort_key = CTRL_C
CMD: run [mypath.rootproject.out.debug]myexecutable.exe
DBG: %DEBUG-I-NODSTS, no Debugger Symbol Table: no DSF file found and
-DEBUG-I-NODSTIMG, no symbols in MY$DISK:[MYPATH.ROOTPROJECT.OUT.DEBUG]MYEXECUTABLE.EXE;1
%DEBUG-I-INITIAL, Language: FORTRAN, Module: MY_SOURCE_CODE

CMD: set scope  0
CMD: step /over


sergey_vorfolomeev
VSI Expert
Contributor
Posts: 19
Joined: Thu Aug 22, 2019 12:17 am
Reputation: 0
Status: Offline

Re: Debugging Issues with Fortran

Post by sergey_vorfolomeev » Fri Sep 20, 2019 7:23 am

to produce listing files use /LIST compiler qualifier
to produce .MAP files use /MAP linker qualifier
the listing files must be in the same location as the object files (project_root.out.debug.obj) and map files must be in the same location as the executable file (project_root.out.debug) before compilation ends, so the extension can download them immediately after compilation


Topic author
cgoodwin
Contributor
Posts: 13
Joined: Wed Aug 21, 2019 8:43 am
Reputation: 0
Status: Offline

Re: Debugging Issues with Fortran

Post by cgoodwin » Mon Sep 23, 2019 9:12 am

to produce listing files use /LIST compiler qualifier
to produce .MAP files use /MAP linker qualifier
the listing files must be in the same location as the object files (project_root.out.debug.obj) and map files must be in the same location as the executable file (project_root.out.debug) before compilation ends, so the extension can download them immediately after compilation
Thanks for the explanation! After making sure to route list and map files to the correct locations, my variables, watch, and call stack windows seem to be functioning, however, my breakpoints are still being skipped. Any ideas on what could be causing this? I think it may have to do with some code execution from the includes, but I'm not sure how to tell. Also, is there a way to specify a path to the various files for the project (list, map, exe, dbg, etc)? We have a custom compiler and linker that outputs these files all in very specific directories. Right now I'm getting around this by copying the files after it compiles and link in the com file, but this just seems messy as compared to just using the original files in the location that they are in.

Edit: As a side note, this is the output when I set the break point:
CMD: set break MY_PROGRAM\%line 1030
DBG: %DEBUG-E-LINEINFO, no line 1030, previous line is 1, next line is 2991
Last edited by cgoodwin on Mon Sep 23, 2019 11:40 am, edited 3 times in total.


sergey_vorfolomeev
VSI Expert
Contributor
Posts: 19
Joined: Thu Aug 22, 2019 12:17 am
Reputation: 0
Status: Offline

Re: Debugging Issues with Fortran

Post by sergey_vorfolomeev » Tue Sep 24, 2019 12:20 am

The extension tries to download .LIS and .MAP files from VMS to PC right after the compilation.
Destination is ${workspaceFolder}\OUT\DEBUG\OBJ for .LIS and ${workspaceFolder}\OUT\DEBUG for .MAP
fortran_lis.png
If these folders are empty, the extension could not find and download the files. You may download them manually.
If some files are in these folders, they may not be compatible with the current source files.
Could You please attach source fortran file and corresponding listing file to test?


Topic author
cgoodwin
Contributor
Posts: 13
Joined: Wed Aug 21, 2019 8:43 am
Reputation: 0
Status: Offline

Re: Debugging Issues with Fortran

Post by cgoodwin » Tue Sep 24, 2019 3:04 pm

I do see the lis and map files; it is definitely downloading them and finding them (variable watching works fine). I stripped down the program to a bear-bones application and the break points did work. What I found was that the debugger had issues recognizing which line it was on when I added the include:

Code: Select all

include	'my_logical:mytextlibrary.tlb(my_file_struct)/list'
Is there something I can do to "declare" this as a text library and not step through it when debugging?

Added in 10 minutes 39 seconds:
Just solved the issue! Apparently it didn't like my /list qualifier at the end of that include. Once I removed that, everything worked as expected, breakpoints and all :D

Post Reply