[Mono-dev] patch for reading assemblies
Hi, JB. We have a toold that generates assemblies and when running Cecil to read assemblies generated by this tool we hit a bug in Cecil. The bug is that Cecil code in Mono.Cecil.ReflectionRead.VisitTypeDefinitionCollection assumed that an outer class must appear nt the type reference table before its inner classes. The attached patch fixes this issue. Please review. Eyal.Index: Mono.Cecil/ReflectionReader.cs === --- Mono.Cecil/ReflectionReader.cs (revision 59261) +++ Mono.Cecil/ReflectionReader.cs (working copy) @@ -398,36 +398,7 @@ m_typeRefs = new TypeReference [typesRef.Rows.Count]; for (int i = 0; i < typesRef.Rows.Count; i++) { - TypeRefRow type = typesRef [i]; - IMetadataScope scope = null; - TypeReference parent = null; - switch (type.ResolutionScope.TokenType) { - case TokenType.AssemblyRef : - scope = m_module.AssemblyReferences [(int) type.ResolutionScope.RID - 1]; - break; - case TokenType.ModuleRef : - scope = m_module.ModuleReferences [(int) type.ResolutionScope.RID - 1]; - break; - case TokenType.Module : - scope = m_module.Assembly.Modules [(int) type.ResolutionScope.RID - 1]; - break; - case TokenType.TypeRef : - parent = GetTypeRefAt (type.ResolutionScope.RID); - scope = parent.Scope; - break; - } - - TypeReference t = new TypeReference ( - m_root.Streams.StringsHeap [type.Name], - m_root.Streams.StringsHeap [type.Namespace], - scope); - t.MetadataToken = MetadataToken.FromMetadataRow (TokenType.TypeRef, i); - - if (parent != null) - t.DeclaringType = parent; - - m_typeRefs [i] = t; - m_module.TypeReferences.Add (t); + AddTypeRef(typesRef, i); } } else @@ -451,6 +422,45 @@ ReadMemberReferences (); } + void AddTypeRef(TypeRefTable typesRef, int i) + { + // Check if index has been already added. + if (m_typeRefs[i] != null) + return; + + TypeRefRow type = typesRef [i]; + IMetadataScope scope = null; + TypeReference parent = null; + switch (type.ResolutionScope.TokenType) { + case TokenType.AssemblyRef : + scope = m_module.AssemblyReferences [(int) type.ResolutionScope.RID - 1]; + break; + case TokenType.ModuleRef : + scope = m_module.ModuleReferences [(int) type.ResolutionScope.RID - 1]; + break; + case TokenType.Module : + scope = m_module.Assembly.Modules [(int) type.ResolutionScope.RID - 1]; + break; + case TokenType.TypeRef : + AddTypeRef(typesRef, (int)type.ResolutionScope.RID - 1); + parent = GetTypeRefAt (type.ResolutionScope.RID); + scope = parent.Scope; + break; + } + + TypeReference t = new TypeReference ( + m_root.Streams.StringsHeap [type.Name], + m_root.Streams.StringsHeap [type.Namespace], + scope); + t.MetadataToken = MetadataToken.FromMetadataRow (TokenType.TypeRef, i); + + if (parent != null) + t.DeclaringType = parent; + + m_typeRefs [i] = t; + m_module
[Mono-dev] TemplateControlCompiler.cs
Hi, Chris. At revision 56619 you introduced the following code at TemplateControlCompiler.cs:176 if (builder is RootBuilder) { typeString = parser.ClassName; } In my flow, parser.ClassName == "Default_aspx", which is unresolved, but parser.PartialClassName has the correct value of "_Default". At BaseCompiler.Init there is a similar code: if (parser.IsPartial) { ... mainClass = new CodeTypeDeclaration (parser.PartialClassName); ... } else { ... mainClass = new CodeTypeDeclaration (parser.ClassName); } So, what do you think of the following patch? Thank you. Andrew. Index: TemplateControlCompiler.cs === --- TemplateControlCompiler.cs (revision 59261) +++ TemplateControlCompiler.cs (working copy) @@ -174,7 +174,10 @@ if (childrenAsProperties || builder.ControlType == null) { string typeString; if (builder is RootBuilder) { - typeString = parser.ClassName; + if (parser.IsPartial) + typeString = parser.PartialClassName; + else + typeString = parser.ClassName; } else { if (builder.ControlType != null && builder.isProperty && ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] patch for reading assemblies
Hi Eyal, Thanks for your patch. Please format your code using the Mono coding guideline: MethodDecOrCall () array [index] Once this is done, please commit. Thanks again, Jb On Apr 9, 2006, at 3:11 PM, Eyal Alaluf wrote: Hi, JB. We have a toold that generates assemblies and when running Cecil to read assemblies generated by this tool we hit a bug in Cecil. The bug is that Cecil code in Mono.Cecil.ReflectionRead.VisitTypeDefinitionCollection assumed that an outer class must appear nt the type reference table before its inner classes. The attached patch fixes this issue. Please review. Eyal. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Re: What would you like to see in Mono? [.wapi-less config]
Hi, So will such a configure variable be added? Or will MONO_DISABLE_SHM be reintroduced? I've had several people complaining about that our web player creates folders in the home directory. Joachim Ante ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] HttpRequest.MapPath and UrlUtils.Combine code duplication
Hello. I found code duplication, please review the patch to remove it. If no one objects, I will commit. Index: UrlUtils.cs === --- UrlUtils.cs (revision 59261) +++ UrlUtils.cs (working copy) @@ -101,7 +101,9 @@ if (rlength == 0) return ""; - relPath = relPath.Replace ("\\", "/"); + if (System.IO.Path.DirectorySeparatorChar != '/') + relPath = relPath.Replace (System.IO.Path.DirectorySeparatorChar, '/'); + if (IsRooted (relPath)) return Canonic (relPath); Index: HttpRequest.cs === --- HttpRequest.cs (revision 59261) +++ HttpRequest.cs (working copy) @@ -1163,17 +1163,10 @@ if (virtualPath.StartsWith(vmw.common.IAppDomainConfig.WAR_ROOT_SYMBOL)) return virtualPath; #endif - if (System.IO.Path.DirectorySeparatorChar != '/') - virtualPath = virtualPath.Replace (System.IO.Path.DirectorySeparatorChar, '/'); - - if (UrlUtils.IsRooted (virtualPath)) - virtualPath = UrlUtils.Canonic (virtualPath); - else { - if (baseVirtualDir == null) - baseVirtualDir = RootVirtualDir; - virtualPath = UrlUtils.Combine (baseVirtualDir, virtualPath); - } + if (baseVirtualDir == null) + baseVirtualDir = RootVirtualDir; + virtualPath = UrlUtils.Combine (baseVirtualDir, virtualPath); if (!allowCrossAppMapping){ if (!StrUtils.StartsWith (virtualPath, RootVirtualDir, true)) throw new HttpException ("MapPath: Mapping across applications not allowed"); ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] PATCH: System.Web.UI.WebControls.DataList
Hello, The attached patch enables DataList binding using DataSourceID. (Test inside the patch). If no one objects I’ll commit. Regards, Konstantin Triger datalist.patch Description: datalist.patch ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [PATCH] Add GetString to UnicodeEncoding 2.0 and modify some Encoding wrappers
Looks good. On Sun, 2006-04-09 at 02:11 +0200, Kornél Pál wrote: > Hi, > > UnicodeEncoding overrides GetString in profile 2.0. This makes it possible > to use a faster method without copying bytes to a temporary char array. > > I also noticed that some wrappers of Encoding class are implemented > differently on Mono than on MS.NET that can caouse problems when they are > overridden. > > Please review and approve the patch. > > Kornél > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] HttpRequest.MapPath and UrlUtils.Combine code duplication
On Sun, 2006-04-09 at 08:08 -0700, Andrew Skiba wrote: > Hello. > > I found code duplication, please review the patch to remove it. Sometimes we have ASP.NET files copied from windows that have stuff like 'Src=".\someotherfile.ascx". The code that you're removing handles that. Don't commit. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] PATCH: System.Web.UI.WebControls.DataList
On Sun, 2006-04-09 at 09:29 -0700, Konstantin Triger wrote: > Hello, > The attached patch enables DataList binding using DataSourceID. (Test > inside the patch). > > If no one objects I’ll commit. Please, commit to 1-1-13 and HEAD. Thanks. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Gtk# not found
Well Paulo, It does make sense. On Linux GTK# 2.4 is able to run with most installed linuxes, without forcing people to upgrade GTK+. Windows doesn't come with GTK, so normally it is installed with GTK#, and so in that we can use the latest stable version, as that has also better support for/runs better in Windows. Hope it clarifies things a bit, On 4/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Attached goes the file "erro.txt" with the output. But, yes, my program uses > Gtk# 2.8. > > And, > "The Linux installer comes with gtk# 2.4, while the windows installer > comes with gtk# 2.8." > Am i very stupid or does this not makes any sense at all? > > > > Citando Wade Berrier <[EMAIL PROTECTED]>: > > On Sat, 2006-04-08 at 00:06 +0100, [EMAIL PROTECTED] wrote: > > It was good to know that it was a bug, as a first thing, because i actually > > ended up suspecting that it might have not been a bug. > > And it is good to know that you are still paying attention to it. > > And even better to know that you may be seeing a solution. > > > > I ended up compiling the program with mono 1.1.13.4, to be sure my users > could > > run it without having to install another mono. This time in Windows. > > Yet another funny thing. Tried it in mono 1.1.13.4 (same) in Linux and it > > complained again about not finding Gtk... I had used the .bin installer > (the > > click and run installer). So you may want to check that one too, if that > wasn't > > in the plans already. > > Could you post some details about the error using the Linux installer? > The Linux installer comes with gtk# 2.4, while the windows installer > comes with gtk# 2.8. Maybe that was the issue? > > Please run you app with with setting this first: > > export MONO_LOG_LEVEL=debug > > and post the output so we can debug this. > > Thanks! > > Wade > > > > > > > Citando Mike Kestner <[EMAIL PROTECTED]>: > > > > On Fri, 2006-03-31 at 16:04 +0100, [EMAIL PROTECTED] wrote: > > > That instalation of mono worked. My program seemed to run fine. > > > In the mean time, i noticed that there is another version of mono, > 1.1.13.6, > > and > > > went to try that one. It still gives the same problem. > > > > > > For watever reason, your experimental installer for Windows runs my Gtk# > > 2.4 > > > application while the official mono one does not (neither in Windows nor > in > > > Linux)... > > > > Talked to Wade about this today and we think we figured out why the > > mono-project installers policy stuff wasn't working. He's working on > > the issue. > > > > -- > > Mike Kestner <[EMAIL PROTECTED]> > > > > ___ > > Mono-devel-list mailing list > > Mono-devel-list@lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > > > > > > > __ > > Porque insiste em pagar o dobro? > > Compare o preço da sua ligação à Internet > > http://acesso.portugalmail.pt/maisbarato > > ___ > > Mono-devel-list mailing list > > Mono-devel-list@lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > > __ > Sabe quanto gasta com a sua ligação à Internet? > Verifique aqui: http://acesso.portugalmail.pt/contas > > > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > -- Rafael "Monoman" Teixeira --- As I'm currently working a lot with Java and even fixing Java VMs (JamVM/Kaffe) and GNU Classpath code, I think I may partly borrow the title (Javaman) from my friend Bruno Souza and become the MonoNJavaMan. Yeah, I may currently be crazier than usual... ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [PATCH] Add GetString to UnicodeEncoding 2.0 and modify some Encoding wrappers
Hi, UnicodeEncoding overrides GetString in profile 2.0. This makes it possible to use a faster method without copying bytes to a temporary char array. I also noticed that some wrappers of Encoding class are implemented differently on Mono than on MS.NET that can caouse problems when they are overridden. Please review and approve the patch. Do you have any NUnit test patches as well? Atsushi Eno ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list