Tuesday 15 July 2014

c# - Is the stack trace of function that has been inlined preserved on a thrown exception? -


While compiling execution in the release mode - Enabled with code optimization - inline the compiler Choose the option to meet certain criteria for improving performance

My question is: When an exception is thrown into the body of a function that is inline, then inline Stacktrust information can be preserved regardless of extension Mr.? In other words, will it show the original function as the source of error or will it show the calling function instead?

It depends how the exception was thrown. If you use the throw statement then you do not have any problems, so the jitter will not inline the methods in which to throw when you need a property setter to be faster bits, So be aware of it.

However, if the exception is due to normal performance, such as an NullReferenceException or IndexOutRangeException etc, then yes, you do not see the name of the method on the stack trace if it was underlined. It can make a slight divergence but you can usually find out the calling method's source code and exception type. It is expected that it is relatively small [MethodImpl (MethodImplOptions.NoInlining)] attribute is available to suppress inlineing. Unless you find that it will be helpful, it is usually too late;)

No comments:

Post a Comment