Hi, You have to compile your AOT code using --aot=full, and run the runtime using the --full-aot option. When embedding, the later can be achieved by setting the mono_aot_only variable to TRUE _before_ calling mono_jit_init ().
Zoltan On Mon, Feb 23, 2009 at 6:07 AM, mobbe <peter.mob...@gmail.com> wrote: > > An update on this one...I found a setting in XCode that said "Compile for > Thumb" and that one was set to true. I unchecked it and recompiled > everything and now the code doesn't stop at the same position anymore...now > I get an EXC_BAD_ACCESS on the get_hazardous_pointer...so I am still not > there but at least I cleared the hurdle I first posted about. Since thumb > instructions are 16 bits and ARM mode are 32 bits things must have not been > aligned properly and hence the BAD_INSTRUCTION exceptions. This is the call > stack right now... > > #0 0x0007e0cc in get_hazardous_pointer at domain.c:276 > #1 0x0007e4e8 in mono_jit_info_table_find at domain.c:370 > #2 0x0020f17c in mono_get_generic_context_from_code at > mini-generic-sharing.c:26 > #3 0x0020f5a8 in mono_convert_imt_slot_to_vtable_slot at > mini-trampolines.c:47 > #4 0x0021044c in mono_magic_trampoline at mini-trampolines.c:348 > #5 0x03904524 in method_order_end > > I guess my next step is to research my hazardous_pointers.... > > > > mobbe wrote: >> >> Over the past couple of weeks I have been working with getting the Mono >> framework up and running on the iPhone and I am darn close to have it all >> working.. .I have been able to get the AOT compilation to work and was >> able this morning to startup Mono in full aot mode on the device. Big >> thanks to Zoltan Varga for helping me through all the roadblocks I ran >> into. I have been working with a SVN HEAD version that I updated last >> week sometime. >> >> Next step I took was to try to invoke some methods on classes in the >> msorlib assembly to see if I could execute managed code and this is where >> I ran into a new road block.. >> >> It looks like I am only able to execute .ctor methods!? During the startup >> of Mono it creates a few exceptions (OutOfMemoryException etc..) and it >> invokes its constructor method and passes in parameters. This works just >> fine...and here it is executing managed code. >> >> However, I tried to execute the ToString() method on an instance of the >> Exception class and then the program is interrupted and stopped in the >> prolog for the function mono_get_lmf_addr.. if I continue to run the >> program >> I get a BAD_INSTRUCTION message and the whole thing shuts down... >> >> Here is the code I am trying to execute... >> >> MonoDomain * domain = mono_jit_init(""); >> MonoAssembly* msCorlib = mono_domain_assembly_open (domain,"mscorlib"); >> MonoImage* image = mono_assembly_get_image(msCorlib); >> >> MonoClass *klass = mono_class_from_name (image, "System", "Exception"); >> MonoObject* o = mono_object_new (domain, klass); >> >> MonoMethodDesc* methodDesc = >> mono_method_desc_new("System.Object:ToString", TRUE); >> MonoMethod* toStringMethod = mono_method_desc_search_in_class(methodDesc, >> klass); >> MonoObject* result = mono_runtime_invoke(toStringMethod, o, NULL, NULL); >> >> >> I don't know if it would help you but here is the assembly where it all >> stops... >> mono_get_lmf_addr >> 0x001d5bdc <+0000> push {r4, r5, r7, lr} >> 0x001d5bde <+0002> add r7, sp, #8 >> 0x001d5be0 <+0004> sub sp, #12 <-- stops here >> 0x001d5be2 <+0006> ldr r3, [pc, #76] (0x1d5c30 >> <mono_get_lmf_addr+84>) >> 0x001d5be4 <+0008> add r3, pc >> 0x001d5be6 <+0010> ldr r3, [r3, #0] >> 0x001d5be8 <+0012> adds r0, r3, #0 >> 0x001d5bea <+0014> bl 0x3e640 <TlsGetValue> >> >> I get the same problem if I try to run other methods on other objects or >> static methods as well...Only constructor methods seems to work. >> >> It looks to me that the stack isn't setup properly since it always throws >> the EXC_BAD_INSTRUCTION when trying to access the stack pointer. >> >> I have been banging my head against this problem for two days and right >> now I am not able to figure out how to troubleshoot this. If there is >> anyone out there that have any suggestion on how I should go about >> troubleshooting this I would really appreciate it. It stings a bit to come >> this close and not be able to cross the finish line... >> >> >> Thanks, >> >> > > -- > View this message in context: > http://www.nabble.com/Unable-to-call-methods-on-managed-objects-while-running-Mono-on-the-iPhone-tp22155202p22155556.html > Sent from the Mono - Dev mailing list archive at Nabble.com. > > _______________________________________________ > 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