I have something similar to the following code ...
void function(int x) {
Everything seems to work fine, except when x turns out to be a specific value, say, "273". But x 273 is a rare event, 99.999% of the time is some other value. Now I want to observe the events when this function is called using x = 273, so I would like to insert a breakpoint that only hits with x, this value. Perhaps I could do it like this:
void function(int x) { if (x == 273) {
The problem is that, apparently, the compiler will optimize this if statement because it does nothing. So my question is what should I include in the if statement to make sure it compiles into something ... or should I track the case of x == 273 in a completely different way.
source share