- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I can locate a Break Point in an Internal Procedure but cannot get variable values either by running mouse cursor over variable or in Watch windows in Visual Studio. Internal Procedure appears to work, just can't debug normally. The Internal Procedure uses two global variables that are associated with a USE MODELGlobals in the host routine.Must be doing something wrong, but haven't been able to figure out what the problem is. Code follows, and any comments would be appreciated.
SUBROUTINE DIAminmax(Jmin, Jmax, Wake, iError)
! USE ifwin included in MODELGlobals
USE MODELGlobals
IMPLICIT NONE
INTEGER(4) iret
INTEGER(4) iErr, iError
REAL Dia_min, Dia_max
REAL Jmax, Jmin
REAL Wake ! Wake is not global
REAL Const
REAL N
CHARACTER(giCharLen) cDia
LOGICAL, SAVE :: bDiaChng = .FALSE.
! rangle of possible diameters
Dia_max = (MPH*Wake*1.46667*60.0*Gear_Ratio)/(Jmin*RPM)
Dia_min = Dia_max*(Jmin/Jmax)
....
.... ! calculate Dia_minDia_max here
....
if(Dia .LT. Dia_min) then
Dia = CEILING(Dia_min*100.0)/100.0
iError = Update() ! internal procedure
else if(Dia .GT. Dia_max) then
Dia = FLOOR(Dia_max*100.0)/100.0
iError = Update()
else if(bDiaChng) then
iError = Update()
end if
iError = 1
RETURN
&nb
sp;
CONTAINS
INTEGER FUNCTION Update()
! * Dia and gszDia are Global Variables
! * see USE MODELGlobals above
write(cDia, '(F5.2)', IOSTAT=iErr) Dia
read(cDia, '(F5.2)', IOSTAT=iErr) Dia
cDia = ADJUSTL(cDia)
gszDia = cDia(1:5)//ACHAR(0)
iret = SetWindowText(ghDIA, gszDia)
Update = 1
RETURN
End FUNCTION Update
END
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
No, you're not doing anything wrong. It's a known problem that host-associated variables are not viewable in the debugger. It is something we're working on. Sorry for the inconvenience.
You may be able to add a watch of modname::varname for the variables in the module.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
You can use the scope operator (::) as Steve suggests or if you do not like typing that in then simply declare and use a local pointer.
real, pointer :: pDia
...
pDia => Dia
You can make that work around code conditional compile. Pick an explanitory name such as DEBUG_REQUIRES_SCOPE_HACK. Define this in a general include file. Then when the compiler is fixed you can try the code out by not defining the symbol. Keep the code in for a few updates of the compiler just in case the fix is un-fixed (or if you port your code to a system that is running an older version of the compiler).
Jim Dempsey
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I urge anyone who has encountered this problem to report it to Intel Premier Support. It will help ensure that you obtain a fix as soon as it is available.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Dave
I believe it hasn't been since I still see it. One way to look at the variable values is to go to the calling routine through call-stack. This is, obviously, irritating to say the least but your don't need to declare local pointers and then delete them after debugging.
Abhi
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Abhi,
Thank you for the response, but I am not sure what you are suggesting I do. Suppose I am debugging a contains procedure and want to look at the value of a variable. What exactly do I do?
Thanks,
Dave
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Dave
In the debugging session, check your call-stack window. By clicking on the call from the parent procedure, you can go in that frame. The value of the variable will be available in the watch window and by hovering mouse over it. I have attached two snapshots and one screen-capture movie. I hope this is what you are looking for.
Abhi
