Re: map.xml syntax
Steve Hannah <[email protected]> Tue, 1 Mar 2016 17:06:21 -0800
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <CABiRg+S3CJtEX_ry4rO6Mva=vUZUy58+y=Oo+f9ERN=NhvMTUw@mail.gmail.com> |
Found the problem. I was using the wrong syntax for calling my clinit method. I was using <call type="java.lang.Throwable"....> but should have been using <call class="java.lang.Throwable" ...> Best regards Steve On Tue, Mar 1, 2016 at 4:05 PM, Steve Hannah <[email protected]> wrote: > I'm trying to make some changes to the JDK java.lang.Throwable class. I > have followed the trail to the map.xml file that seems to provide drop-in > replacements for some classes but using XML syntax. What I'm trying to do > is remove the static initializer (cinit), and perform this initialization > lazily. > > Essentially, I'm just adding a static boolean INITIALIZED field, then > created a static method named __clinit() which I call at the beginning of > each method. > > Unfortunately, I seem to have done something wrong here as, when I build, > I now get this error: > > [exec] fatal error IKVMC5042: Type 'java.lang.Throwable' referenced in > remap file was not found > > > My Throwable class (defined in XML) is shown here: > > https://gist.github.com/shannah/84b307b2952a3dab42b3 > > The parts I added are: > > <field name="INITIALIZED" sig="Z" modifiers="static" /> > > and > > <method name="__clinit" sig="()V" modifiers="private static"> > <attribute type="IKVM.Attributes.HideFromJavaAttribute" > sig="()V" /> > <attribute > type="System.ComponentModel.EditorBrowsableAttribute" > sig="(Lcli.System.ComponentModel.EditorBrowsableState;)V"> > <parameter>Never</parameter> > </attribute> > <body> > <ldsfld class="java.lang.Throwable" name="INITIALIZED" > sig="Z" /> > <brfalse name="notinitialized"/> > <ret/> > <label name="notinitialized"/> > > <ldc_i4_1 /> > <stsfld class="java.lang.Throwable" name="INITIALIZED" > sig="Z" /> > > <call type="IKVM.Internal.ExceptionHelper" > name="getPersistentFields" sig="()[Ljava.io.ObjectStreamField;" /> > <stsfld class="java.lang.Throwable" > name="serialPersistentFields" sig="[Ljava.io.ObjectStreamField;" /> > <ldc_i4_0 /> > <newarr sig="Ljava.lang.StackTraceElement;" /> > <stsfld class="java.lang.Throwable" name="UNASSIGNED_STACK" > sig="[Ljava.lang.StackTraceElement;" /> > <ldc_i4_0 /> > <newobj class="java.util.ArrayList" name="<init>" > sig="(I)V" /> > <call class="java.util.Collections" name="unmodifiableList" > sig="(Ljava.util.List;)Ljava.util.List;" /> > <stsfld class="java.lang.Throwable" > name="SUPPRESSED_SENTINEL" sig="Ljava.util.List;" /> > <ret /> > </body> > </method> > > > And I removed the <clinit> tag. > > I also added calls to this __clinit() method at the beginning of each > method <body> in the class def. > > Are there any obvious errors here? > > Is there any way to get it to show a more descriptive error for map.xml > defined classes? Or is there a way to just generate the XML from Java > somehow? > > Any pointers appreciated. > > Best regards > > Steve > > > And > > > -- > Steve Hannah > Web Lite Solutions Corp. > -- Steve Hannah Web Lite Solutions Corp. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Ikvm-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ikvm-developers