--
For more messaging options, visit this group at http://forum.eiffel.com.
Information on the Eiffelstudio project: http://dev.eiffel.com.
Did you look at the generated melted and C code? Is it different from regular compiler code?
If it is different, for some reason the execution does not go the way you like to.
If it is the same, it makes sense to look at code generation under debugger. In melted mode you can put a conditional breakpoint on {MELTED_GENERATOR}.process_instr_list_b, in C mode - on {INSTR_LIST_B}.generate. It's better to use a precompiled library to avoid massive breaks at those breakpoints and a minimal test example to see why it does not work as expected. Also the condition can be used to narrow down the number of breaks even futher, checking on context.current_feature and context.associated_class.
As a side note, would you like to document your experience in extending compiler code at dev.eiffel.com for other people who may want to do similar things, describing what you needed and what should be done, step-by-step, to achieve it?
The best thing to do is to start with a one single line of Eiffel code and compare the whole body of the routine between the two versions. It should guide you. The fact it crashes shows that something does not get initialized properly. Maybe you are calling a routine without providing the Current object as argument, or something along those lines.
Note that the RTHOOK(3) corresponds to the 3rd breakpoint in the flatview of the routine.
Regards,
Manu
The best thing to do is to start with a one single line of Eiffel code and compare the whole body of the routine between the two versions. It should guide you. The fact it crashes shows that something does
not get initialized properly. Maybe you are calling a routine without providing the Current object as argument, or something along those lines.
Note that the RTHOOK(3) corresponds to the 3rd breakpoint in the flatview of the routine.
> There is a new declaration: "EIF_REFERENCE tr3 = NULL" and an a new RTLR (...) call.
Those are for initialization, but what about a feature call?
tr1 = ((up1x = (FUNCTION_CAST(EIF_TYPED_VALUE, (EIF_REFERENCE)) RTWF(7, dtype))(Current)), (((up1x.type & SK_HEAD) == SK_REF)? (EIF_REFERENCE) 0: (up1x.it_r = RTBU(up1x))), (up1x.type = SK_POINTER), up1x.it_r);
> MELTED_GENERATOR.process_instr_list_b never gets executed.
It should be executed only if you perform melt operation, not freeze.
loc1 = RTMS_EX_H("Does the assignment get processed\? \012",36,632077066);
tr1 = ((up1x = (FUNCTION_CAST(EIF_TYPED_VALUE, (EIF_REFERENCE)) RTWF(7, dtype))(Current)), (((up1x.type & SK_HEAD) == SK_REF)? (EIF_REFERENCE) 0: (up1x.it_r = RTBU(up1x))), (up1x.type = SK_POINTER), up1x.it_r);
> 2) How do I create an object representing a feature call?
ACCESS_B is a descendant of CALL_B, so everything seems to be OK. If we were talking about a feature call used as an instruction, it could be wrapped in INSTR_CALL_B as done in process_instr_call_as. You can try that to see if it helps.
--
It's a bit difficult to follow all the possibilities you try, as sometimes the feature in ANY is a procedure without arguments, in the example in the last mail it is a procedure with one argument, and in the generated code it looks like a call to a function, because it returns a value.
Would it work if you send your version of ANY and I'll prepare a patch that calls the feature you want to after every assignment?Alexander Kogtenkov
--