How Can I Find Out Who Is Passing a Wrong Parameter Value?
Full Problem Description: I’ve discovered that the wrong parameter value is being passed to one of my functions. This function is called from all over the place. How can I find out who’s passing it the wrong value?
Using the Breakpoints dialog box, set a location breakpoint at the beginning of the function. Then click Condition, and use the Breakpoints Condition dialog box to enter an expression, such as Var==3
, where Var
is the name of the function being passed the bad value, and 3
is the bad value passed to it.
Now run the program again. The breakpoint causes the program to halt at the beginning of the function when Var
has the value 3
. You can then use the Call Stack window to find the calling function and navigate to its source code. For more information, see and .