- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With CVF Fortran I was able to reliably set a breakpoint that would be executed when the value of some variable or array element changed. With IVF 11.1.060 and VS2005 I can set breakpoints like that but it seems that the breakpoints are not very reliable. Sometimes they work, but they usually don't. From the Debug Menu I choose New Breakpoint, New Data Breakpoint, then type in something like arrayname(12). Am I missing something?
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's the way - and it is no more or less reliable than it was in CVF. Data breakpoints have never been a strong point of Visual Studio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I mentioned CVF, but at that time I was also using Developer Studio prior to Visual Studio. I tested it some more today and it worked every time. I do remember that it didn't work every time with CVF/DS either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sometimes this trick will work when all else fails
Open the Memory window (memory dump window)
Enter in the name of the variable of interest (or array with subscript of interest)
After you hit the enter key, the location where you enter the variable name changes to the hex address of that variable. Use the mouse to select the entire hex address (click on one side, drag across to other side of address) then copy the hex address into the paste buffer.
Next, open the Debug | Break points window,
Now in place of entering the variable name, paste in the hex address. Choose C expression evaluation, and choose 4 bytes even for doubles. I've had some problems with 8 byte data change break points.
This worked for me.
Also note, the data change break points seem to get cleared or half cleared on restart of the application (new debug session). At times the Debug |Breakpoints will not show the break point, but the debugger is inserting the INT03 or INT21 or setting the HW debug on memory change registers. I found the only way to clear this (as they are not listed) is to Clear All break points and start over.
Jim Dempsey
Open the Memory window (memory dump window)
Enter in the name of the variable of interest (or array with subscript of interest)
After you hit the enter key, the location where you enter the variable name changes to the hex address of that variable. Use the mouse to select the entire hex address (click on one side, drag across to other side of address) then copy the hex address into the paste buffer.
Next, open the Debug | Break points window,
Now in place of entering the variable name, paste in the hex address. Choose C expression evaluation, and choose 4 bytes even for doubles. I've had some problems with 8 byte data change break points.
This worked for me.
Also note, the data change break points seem to get cleared or half cleared on restart of the application (new debug session). At times the Debug |Breakpoints will not show the break point, but the debugger is inserting the INT03 or INT21 or setting the HW debug on memory change registers. I found the only way to clear this (as they are not listed) is to Clear All break points and start over.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I got that method to work. Good to know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A somewhat faster method to obtain the address in hexadecimal form would be to type
LOC(yourVariableName),x
in watch or QuickWatch window. I agree with other Jim's points.
LOC(yourVariableName),x
in watch or QuickWatch window. I agree with other Jim's points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
Does this work in the Debug | Break on Data change dialog?
My guess as to the problem is the Debug | Break on Data change dialog context falls back to C/C++ syntax and this bungs up the interpretation of "yourVariableName". As to if this contaminates the "LOC(yourVariableName)" as well I cannot say (not on system to run test).
tsimm,
Try LOC() if it works then use it as it is much less work to do.
Jim
Does this work in the Debug | Break on Data change dialog?
My guess as to the problem is the Debug | Break on Data change dialog context falls back to C/C++ syntax and this bungs up the interpretation of "yourVariableName". As to if this contaminates the "LOC(yourVariableName)" as well I cannot say (not on system to run test).
tsimm,
Try LOC() if it works then use it as it is much less work to do.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried LOC(arrayname(n)) as the address for the data breakpoint and it worked every time. Hopefully it will continue to work reliably. Using arrayname(n) as the address works sometimes too, but not always. 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