- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry if this is dumb question and that I never seemed to notice this before, but:
Is it possible that, for debugging, breakpoints cant be set in a Function?
If this is true, what a disadvantage! I swear I never noticed this before.
I was trying to trace a simple routine that calls a Function (not a subroutine) and set a couple breakpoints in that Function. The Function gets called properly but debug never stops there - zooms right past.
Is it possible that, for debugging, breakpoints cant be set in a Function?
If this is true, what a disadvantage! I swear I never noticed this before.
I was trying to trace a simple routine that calls a Function (not a subroutine) and set a couple breakpoints in that Function. The Function gets called properly but debug never stops there - zooms right past.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Breakpoints can be set in a function and do work. Did you try setting a breakpoint at the start of the function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep.
Since the function is only a dozen lines or so, I put a stop sign on every executable line. It zooms right past. Not sure I ever saw anything quite like this. Quite the puzzler ...
Since the function is only a dozen lines or so, I put a stop sign on every executable line. It zooms right past. Not sure I ever saw anything quite like this. Quite the puzzler ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That suggests that the routine you set breakpoints in isn't the one that was called. If you stop at the call to the function and step in, what happens? Or is this a DLL being called from managed code? If so, you need to enable unmanaged code debugging in the Debugging property page of the managed code project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You make a good point, Steve - this is something that occurred to me, too. So I set a break exactly where in Main that the function gets called. F10 steps right over the function call and executes the next line in Main! It never goes out to the Function below.
And no, there's no DLL involved or anything like that. This code is ultra simple.
Hey - I just now figured it out (this is weird):
The function I was using {Ran()} was for generating random numbers and created for F77. I naively oported it to F90 w/o eralizing that F90 has in intrinsic function Ran(). So all the while I was crunching the Main along thinking it was using my function, it was using the F90 intrinsic of the same name! So of course it never traced to the stops in my function: it never went there. And it ain't even Halloween yet!
And no, there's no DLL involved or anything like that. This code is ultra simple.
Hey - I just now figured it out (this is weird):
The function I was using {Ran()} was for generating random numbers and created for F77. I naively oported it to F90 w/o eralizing that F90 has in intrinsic function Ran(). So all the while I was crunching the Main along thinking it was using my function, it was using the F90 intrinsic of the same name! So of course it never traced to the stops in my function: it never went there. And it ain't even Halloween yet!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep. The Fortran 90 language does not define RAN as an intrinsic, but the Intel compiler does. Adding EXTERNAL RAN would override this and let your function be called.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah hahhhh - you just answered another question. In searching, I didn't see where Ran() is a valid F90 intrinsic (zero documentation) but I know for sure it gets implemented. Now you explain why this is happening. I'll try 'EXTERNAL RAN'. Thanks.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page