View previous topic :: View next topic |
Author |
Message |
JMoody
Joined: 26 Aug 2008 Posts: 20 Location: Ohio
|
Posted: Mon Mar 09, 2020 2:53 pm Post subject: Debugging Issue with VS2019 and 8.61 |
|
|
I am having problems with using the 8.61 plugin for VS2019. I cannot see the values of passed variables in functions or subroutines.
I have made a small project that shows the problem. You can download the project here: http://files.unitedmcgill.com/owncloud/index.php/s/qgw12bc5HcrXjjJ
Basically, we have a C# project that calls a method in a Fortran DLL. That method will call other subroutines/functions to do calculations. When you put a breakpoint in, you can see the values of variables that have been declared in the current method, but you cannot see the values that have been passed into the current method.
Here is the Fortran code:
Code: | FUNCTION CALC_AREA(CSharpInput)
IMPLICIT NONE
ASSEMBLY_INTERFACE(NAME='Calc_Area')
!-- Passed Variables
OBJECT("FTNDebugTest.DataContract.ClassInput") CSharpInput
!-- Local Variables
OBJECT("FTNDebugTest.DataContract.ClassOutput") CALC_AREA
OBJECT("FTNDebugTest.DataContract.ClassOutput") CSharpOutput
REAL WIDTH, HEIGHT, AREA
WIDTH = CSharpInput%Width
HEIGHT = CSharpInput%Height
CALL CALCAREA(WIDTH, HEIGHT, AREA)
CSharpOutput = new@("FTNDebugTest.DataContract.ClassOutput")
CSharpOutput%Area = AREA
CALC_AREA = CSharpOutput
RETURN
END
! --------------------------------------------------
SUBROUTINE CALCAREA(WIDTH1, HEIGHT1, AREA1)
IMPLICIT NONE
REAL WIDTH1, HEIGHT1, AREA1
AREA1 = WIDTH1*HEIGHT1
RETURN
END |
When I put a breakpoint at the call to CALCAREA, I can see the values of WIDTH, HEIGHT, and AREA. When I step into CALCAREA, I get the error CS0103: The name 'WIDTH1' does not exist in the current content. for all the passed variables.
When I open the exact same project under VS2013/8.05, I can see the values of the passed variables just fine.
Jill |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 445 Location: Manchester
|
Posted: Mon Mar 09, 2020 6:22 pm Post subject: |
|
|
Hi Jill
Did you turn on the debugger managed compatibility mode?
Tools->Options->Debugging->General->Use Managed Compatibility Mode |
|
Back to top |
|
|
JMoody
Joined: 26 Aug 2008 Posts: 20 Location: Ohio
|
Posted: Mon Mar 09, 2020 6:26 pm Post subject: |
|
|
Thanks. That fixed it. I thought I had compared all the VS settings between my new and old computer, but I missed that one. |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 445 Location: Manchester
|
Posted: Mon Mar 09, 2020 6:57 pm Post subject: |
|
|
Previous versions of VS used to display a message box upon first debug reminding about Managed mode. Maybe they turned it off in VS2019. |
|
Back to top |
|
|
|