Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dev Studio debugger strangeness

2 views
Skip to first unread message

toastrmaster67

unread,
Oct 22, 2002, 4:52:51 PM10/22/02
to
I ran into something very strange in the Dev Studio debugger (Visual
Fortran Professional Edition 6.1.A).

At the very end of a subroutine, I view the contents of a 3x40 array
with the Watch window. To do this, I type array(1:3,1:40). Then, I
return from the subroutine, and the contents are completely different.
After checking and double checking my arguments to make sure they
were declared consistently, I decided to print out the array contents
with WRITE statements. Lo and behold, there is no difference; the
array has the same contents before and after the return. I've also
checked the memory addresses of a few elements, and they are the same
as well.

Why is the Dev Studio debugger misleading me about the contents of the
array? I'd appreciate any enlightenment.

Jugoslav Dujic

unread,
Oct 23, 2002, 3:31:44 AM10/23/02
to
"toastrmaster67" <toastm...@yahoo.com> wrote in message
news:f95f45dd.02102...@posting.google.com...

Yes, I've seen debugger a bit confused when displaying array elements,
especially when changing routine context. My speculation is that debugger
evaluates symbol "array" from the routine as *(SP+offset) where SP is
stack pointer; when the routine is exited, stack is cleared and there's
now garbage at that position, but VS does not refresh the contents. IIRC,
"collapsing" and then "expanding" the array in the Watch window fixes it.

It's better to point CVF-specific questions to Intel Developer Forum at

http://intel.forums.liveworld.com/forum.jsp?forum=76

--
Jugoslav
___________
www.geocities.com/jdujic


Patrick

unread,
Oct 23, 2002, 7:05:29 AM10/23/02
to
toastm...@yahoo.com (toastrmaster67) wrote in message news:<f95f45dd.02102...@posting.google.com>...

I noticed the same behaviour, and it made me panic, too.

One thing to do after returning from your subroutine is to click the
little "-" sign at he left of your array name, and then clicking the
"+" again to expand the array. The values shown for your array should
be the correct ones.

I don't know exactly why this happens, but I suppose this is due to
the fact that your arrays may be located at different places (stack,
heap..) in different subroutines. I'm not a computer expert, but it
should be something like that. The debugger shows the content of some
specific location, and when returning from a subroutine, the content
of this location has changed, because the memory is organized in a
different manner. Minimizing and expanding your array again causes the
debuggger to look up the new location of this array, and thus gives
you the correct values.

I repeat, the preceding paragraph is my personal interpretation....

Hope this helps
Pat

0 new messages