Release-only bugs?

Started by
17 comments, last by discman1028 18 years, 1 month ago
You can use #pragma optimize("",off) and #pragma optimize("",on) to turn optimizations off and back on for specific pieces of code.

Also, there's no real hurt to learning how to debug the assembly and watch the values that are going through your registers. If you pay attention to how the compiler is using registers you can provide a type in the watch window like (AStarNode *)eax and it'll understand what you mean.

I've found it's also incredibly useful to use the Memory window (Ctl-Alt-m 1). It lets you view a big chunk of memory as whatever type you want (chars, shorts, floats, longs, etc), and set the number of columns.

Say you have this big array of AStarNode's which each are 16-bytes with 2 pointers and 2 32-bit values. You can set your Memory type to represent 'unsigned / 4-byte int / hexadecimal' and the number of columns to be 4, and you'll see your whole big array at once all nicely lined up. That way, it will be easy to tell at a glance if there's any funny business or uninitialized values sneaking in. It doesn't hurt to watch the memory evolve in debug, and do the same thing in release to see if anything looks fishy.

Of course, it's a little crazy at first :)
Advertisement
Quote:Original post by Enigma
Quote:Original post by OrangyTang
I haven't had to track down a release-only crash in ages. Oh wait, thats because I'm using a non retarded language instead of C++. </flamebait>

<don't-take-this-the-wrong-way-i'm-only-kidding>
So in light of the fact that I use C++ regularly and excluding the extremely low level code I've been writing these last few days I haven't had a release-only crash in ages either (or in fact a crash at all since I rarely use a debugger) where does that put the retardedness? With C++ or with you?
</don't-take-this-the-wrong-way-i'm-only-kidding>

Σnigma


Dictionary.com
(Definition of 'retarded')

1 - To cause to move or proceed slowly; delay or impede.
I think release/debug modes can respond to memory access errors in different ways, sometimes.
The thread topic is all too familiar, I've run across this many times too. Yep, problems can be hard to reproduce... however, there is a way to disable the zeroing-out of all values when using Debug mode. That way you can step through the program; It's as if running in Release mode, only Matrix-style (go Neo!).

And I forsee this topic being 10 pages long, since someone insulted C++ (the best language of all time). </more_flamebait>
--== discman1028 ==--
<plaintext>
Quote:Original post by discman1028
And I forsee this topic being 10 pages long, since someone insulted C++ (the best language of all time). </more_flamebait>


Bait accepted. You're clearly an idiot. My revolutionary new language will make C++ look like it was designed by someone less intelligent than a common garden slug high on the best Mendocino weed. GOBOL - Gamers' COBOL - is going to revolutionize game programming. You'll be able to make games with half the typing and a quarter of the thinking that goes into current games. As a bonus (a bonus, people!) it will print out pretty reports.

>I haven't had to track down a release-only crash in ages. Oh wait, thats
>because I'm using a non retarded language instead of C++. </flamebait>
Very nice for you,

However I fail to see how your comment helps the original poster.
visit my website at www.kalmiya.com
Quote:Original post by Kitt3n
Very nice for you,

However I fail to see how your comment helps the original poster.
Then the problem is in you, because his rating is clearly higher than yours. So he must be a helpful poster.

Quote:Original post by Troll
...a quarter of the thinking that goes into current games.


Just what we need!

Seriously though, do you have a page with progress?
--== discman1028 ==--

This topic is closed to new replies.

Advertisement