1

I seem to be having an issue using the call stack viewing functionality of Microsoft Visual Studio 2010 Professional.

During debugging, my application crashed, so I inspected it with the call stack view.

The offending line was contained within called showInDGV(...) nothing exciting, just trying to read an uninitialized variable or something...

All well and good, so next thing I did was check to see where the call to showInDGV() was coming from, because it is called from multiple places.

When double clicking the entry in the call stack (the entry that should highlight a showInDGV(...) subroutine call), the IDE highlighted the incorrect line.

Instead of highlighting showInDGV(), it highlighted the next non-empty line below it, which was End Sub

Clearly something is wrong here....

So I inspected the call stack further - turns out Visual Studio is highlithing the wrong line whenever I try to debug using the call stack.

This isn't actually the first time this has happened. In fact, it seems to always happen when working on a large project.

Initially, the call stack works properly and highlights the correct line, but at some point it gets messed up, and then it never seems to fix itself, even after closing and re-opening the program.

Does anyone know the cause/solution to this issue? I figure it might be some sort of corruption in the visual studio project, and I considered copying and pasting the source code into a new project but even if that fixed it, it wouldn't prevent it from happening again.

Allen
  • 927
  • 8
  • 19
  • 1
    Silly question - did a restart of VS fix it? I've seen really wacky things fixed by simply closing and restarting the program. – Jason Faulkner Jan 02 '15 at 21:28
  • Clean and Rebuild - it sounds like the symbols are out of date – Ňɏssa Pøngjǣrdenlarp Jan 02 '15 at 21:30
  • Restarting did not make a difference. I also tried to clean and rebuild it by using the "Clean" functionality in the Build menu, and then clicking "Rebuild". (I tried for the entire solution, as well as the application only, since there were 2 menu options) and even tried combining this with a restart of the application; clean, close, restart, rebuild. Unfortunately, the issue persists unchanged. – Allen Jan 02 '15 at 21:40
  • It often happens to me. Especially irritating when profiling, because you never know if it's the line you are looking at causing the issue, or the one above it. Fortunately, if you are diligent with code, this assumption becomes obvious, and the original issue does not cause any serious problem. And no, I don't know why it happens. – Victor Zakharov Jan 02 '15 at 21:40
  • Yea, I wouldn't say that its particularly hard to figure out, because you can always go 1 layer deeper into the stack and it will take you to the subroutine. Then you just go back up the stack, finding the subroutine call that is close to the right place. It just slows down the whole debugging process. The total time spent certainly adds up, so I figure it would be in my best interest if I could figure out how to fix this, rather than just dealing with it perpetually. – Allen Jan 02 '15 at 21:46
  • For people that have had a similar issue: Have you noticed that once it happens in a project, the issue tends to stay? None of my small projects seem to have this issue, but spend a few months working on a large project, and it seems like this bug is inevitable, at least for me. – Allen Jan 02 '15 at 21:49
  • I've seen this happen in other IDEs when a line is missing one half of the CR/LF pair (in particular, Delphi's IDE); it somehow confuses the line number count when jumping into code from other places. File->Advanced Save Options->Line Endings->Windows, and then saving the file again might fix things if that's the case. There used to be a context menu item that did this - see http://stackoverflow.com/q/553548/62576 – Ken White Jan 02 '15 at 22:46
  • Well, I see how that could happen... I tried saving with windows newline settings like you said, and then closed the IDE and re-opened it. Didn't fix it, unfortunately. – Allen Jan 05 '15 at 17:16

0 Answers0