- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a derived type like say:
TYPE tst
REAL A
REAL B
END TYPE
TYPE(tst) ::TR(50,60)
now while debuging I want to see B content of a row or column of TR, the first thing comes to my mind is to write TR(10,:).B in the watch menu but it says: " 'TR(10,:)' is not an structure" how should I do this? I don't want to write all the row one by one in watch window like TR(10,11).B etc
TYPE tst
REAL A
REAL B
END TYPE
TYPE(tst) ::TR(50,60)
now while debuging I want to see B content of a row or column of TR, the first thing comes to my mind is to write TR(10,:).B in the watch menu but it says: " 'TR(10,:)' is not an structure" how should I do this? I don't want to write all the row one by one in watch window like TR(10,11).B etc
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is something I would put high on my want list as well.
I sometimes use this approach but it does need temporary code:
real, pointer col(:), row(:)
integer c,r
c = 1
col => TR(c,:)%B
r = 1
row => TR(:,r)%B
Now you can see rows or columns of B in the debugger by viewing the pointers. You can and even re-assign the pointers at runtime by changing the c or r variables and moving the execution point back.
I sometimes use this approach but it does need temporary code:
real, pointer col(:), row(:)
integer c,r
c = 1
col => TR(c,:)%B
r = 1
row => TR(:,r)%B
Now you can see rows or columns of B in the debugger by viewing the pointers. You can and even re-assign the pointers at runtime by changing the c or r variables and moving the execution point back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's already a feature request in for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good point Andrew. This code can be inserted in as conditional compiled for DEBUG mode (so it is automatically removed in Release build). I've used this technique many times before.
Note, if you place your break point just after the col=>... you can then use the debugger to modify the value of c, then use "set next statement" back to the col=>... and continue (exicuting the one statement). This method is not too bad to use to get what you want in the Watch window.
Also note that the conditional debug code can be surrounded by IF (trigger expression) THEN ... ENDIF and then your debug break point only triggers under the specified conditions.
Jim Dempsey
Note, if you place your break point just after the col=>... you can then use the debugger to modify the value of c, then use "set next statement" back to the col=>... and continue (exicuting the one statement). This method is not too bad to use to get what you want in the Watch window.
Also note that the conditional debug code can be surrounded by IF (trigger expression) THEN ... ENDIF and then your debug break point only triggers under the specified conditions.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve
Andew this is a really good one but it's burdersome because if you see the bug was not in the subroutine you thought and you have to check the other you need to stop debugging move this piece of code to next one etc.. or you have to write it in all of your subroutines which will be a mess!
yet the best way is using your method till this feature be available.
Steve when this feature get ready will it be available for users of older versions by a patch? I'm using VS2008
Andew this is a really good one but it's burdersome because if you see the bug was not in the subroutine you thought and you have to check the other you need to stop debugging move this piece of code to next one etc.. or you have to write it in all of your subroutines which will be a mess!
yet the best way is using your method till this feature be available.
Steve when this feature get ready will it be available for users of older versions by a patch? I'm using VS2008
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We don't patch, and generally do not introduce new VS features in updates. If this feature gets implemented, it would appear in a new version.

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