debugging – Automate dumping of local variable values in visual studio debug


I have been tasked to write unit tests for a fairly large fortran code base (100K+ loc)

I would like to automate the process as much as possible and am hoping to use visual studio to do this.

Here is my plan:

1.) put break points near the beginning of each subroutine (after the common block variables are defined)

2.) put break points at each exit point of each of the subroutins

  1. when the code execution gets to each of the break points the variables in the locals window gets dumped to a file.

4.) parse this file with all the dumped variable data and write a script to write out unit tests for me. ​

I have searched through for an idea of how to automate #3 but have yet to find a clear way

Could be that I’m not googling the right terms so I figured it wouldn’t hurt to ask this community.

I am able to put the break points in visual studio and while running the debug in VS it provides me the locals window with the information I need to dump to file.

I was thinking that if I could run scripts in the immediate window in an automated way then that might output what I need.

Leave a Reply

Your email address will not be published. Required fields are marked *