'Visual Studio won't show debugging info and generates duff builds
I'm working on a large project in C++ using Visual Studio, but it very regularly either produces a duff build (the executable it generates doesn't match the code, resulting in random crashes or the inability to set breakpoints) or refuses to give any debug info for many of the types. For example, a vector of very simple structs stored by value will be displayed as "size: attempt to divide by zero". You can't drill down into the entries of the vector to see the values, and you get a similar thing for lists only you see a bunch of question marks instead of the divide by zero error.
This doesn't just affect standard library containers, but they are some of the worst culprits because they so often behave in this way. Doing a complete rebuild of the code will maybe rectify the problem 10% of the time, but it's completely unpredictable. I have found that writing shorter C++ files (I literally mean the file size, nothing to do with the objects themselves) can sometimes help, but I suspect that's just down to luck. It really doesn't make much sense that it could be relevant, anyway.
I work as part of a team on the same project, and only two of us seem to run into these kind of gnarly problems on a daily basis.
If anyone has any suggestions as to how I might be able to get the VS debugger to behave, I would be incredibly grateful.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
