[Mono-dev] Cecil Design Concerns

Sebastien Pouliot sebastien.pouliot at gmail.com
Wed Aug 27 21:42:56 EDT 2008


On Wed, 2008-08-27 at 18:27 -0700, sidarok wrote:
> 
> 
> Sebastien Pouliot-2 wrote:
> > 
> > On Wed, 2008-08-27 at 17:23 -0700, sidarok wrote:
> >> And one addition, the library is not written in a testability in mind
> >> perspective. I'd like to see comments on this.  
> > 
> > Cecil itself is not easy to test and there are very few unit tests right
> > now (contributions are welcomed :-). However it's easy to test at higher
> > levels. E.g. I remember JB round-tripping mono assemblies (reading +
> > writing) and running mono's unit tests on them.
> > 
> > Speaking of JB, he is on vacations this week - so it may take a while to
> > get your "official" answers. In the mean time you may want to check, or
> > subscribe to, the google group's archive [1].
> > 
> > Sebastien
> > 
> > [1] http://groups.google.com/group/mono-cecil?hl=en
> > 
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> > 
> > 
> 
> Thank you very much Sebastien. Can you point me to those tests somehow ? 

some are here:
http://anonsvn.mono-project.com/viewvc/trunk/cecil/tests/

but I don't recall where I put mine for OpCodes... so there could be
others

> I
> am ready to contribute in every aspect - I mailed jb and never received a
> reply, so your post explains why :) 
> 
> I searched the posts but found no luck.  I am trying to write an engine that
> will make retrieving plain text code easier on top of CECIL,

Well you can't exactly "retrieve" it - unless you have debugging symbols
pointing to the original (and available) source file ;-) so I guess you
want to decompile assemblies into C# (or another language) ?

>  and since my
> reflection provider is CECIL and the library itsself is a reflection,
> although I was able to seperate some Concerns I wasn't successful in
> Abstracting or Mocking out CECIL because of these concerns. 
> 
> Do you, or anybody know any sort of library or function that exists to make
> my life easier ? 

That should help:
http://anonsvn.mono-project.com/viewvc/trunk/cecil/flowanalysis/

I know JB has plans to update it but I don't recall the timeline for
those changes...

> Or do I need to write a translation engine on top of
> existing CIL intructions within scopes ?

Yes, you will need some custom, language specific, code to regenerate
source code that match, without being identical, the original source
code.

Sebastien

> Thanks a lot. 
> 
> Sidar
> 



More information about the Mono-devel-list mailing list