[Mono-dev] Gendarme rule addition

Russell Morris russell at russellsprojects.com
Fri May 19 22:59:58 EDT 2006


Hello all,

I've attached an svn diff for the exception management rule I've written 
for gendarme.  The bulk of the diff is new code in 
./cecil/gendarme/rules/Gendarme.Rules.ExceptionMgmt.  In addition to 
this, it also updates the following files in ./cecil/gendarme:

./configure.ac : Updated to include the new 
./rules/Gendarme.Rules.ExceptionMgmt stuff
./rules/Makefile.am : Updated to include the new 
./rules/Gendarme.Rules.ExceptionMgmt stuff
./rules/rules.xml : Updated to include the new ExceptionMgmt rule in 
default set, and to also add a set that contains only the ExceptionMgmt rule

I've also run the rule against System.dll and System.Web.dll (from a 
very recent mono 1 install), and the following results were had:

System.dll
1. System.Net.Sockets.TcpClient::Connect() IL offset 0x00de
2. System.Net.Sockets.UdpClient::Connect() IL offset 0x0082
3. System.Net.WebConnection::EndRead() IL offset 0x0100

System.Web.dll
1. System.Web.SessionState.SessionSQLServerHandler::Init() IL offset 0x00a1

Each hit above indicates that the IL instruction at the noted offset is 
using code equivalent to 'throw ex;' in an exception block to throw the 
exception that was originally caught by the exception block itself.  
This code should instead use 'throw;' to rethrow the exception without 
destroying the stack trace held in the exception's .StackTrace.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ExceptionMgmt1.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060519/64160774/attachment.pl 


More information about the Mono-devel-list mailing list