c# - how to create a more accurate Break Point or Try/Catch -
i have 2 loops outer repeat 64 times know there index out of bound error how can set break point or try/catch block,etc shows me index , line of code causing problem. ( c# winapp)
thanks all.
in vs debugger, can enable "break on thrown exception" in exceptions dialog. don't need set breakpoint, debugger automatically stop when exception raised.
you make change in: debug >> exceptions >> common language runtime exceptions
just check appropriate exception in "thrown" column in dialog:
alt text http://img248.imageshack.us/img248/5733/breakg.png
if need break before exception raised (let's inspect volatile data), it's possible set conditional breakpoints on particular line breaks when condition in code true. this, can set regular breakpoint , right click on red circle icon in margin , select: [condition...].
this brings conditional breakpoint dialog can write expression cause debugger break when evaluated true (or when value changes). breakpoint conditions can bit finicky, if stick simple variables in code works well.
Comments
Post a Comment