[Mono-dev] Mono Debugger on Mips: Invalidate ICache?

Harald Krapfenbauer krapfenbauer at ict.tuwien.ac.at
Mon Jul 14 06:00:38 EDT 2008


Hello Martin et al.,

Since the MIPS architecture needs invalidation of the ICache after
generating code, this is a significant issue with the Mono debugger.

Every time some code is generated in the inferior, a breakpoint is set
or removed, an instruction is executed (from the code buffer), etc., the
caches must be invalidated, as far as I understand.

What would be the best solution in the Mono debugger to meet these
requirements?
In the Mono runtime, mono_arch_flush_icache() seems to do that job. I
could pass this function address in the MonoDebuggerInfo table and
execute it everytime it's needed. Since after its execution I would
insert a breakpoint and the inferior would halt, the backend C# code
must be aware of it, I think.
On some MIPS processors, there's a SYNCI instruction that also will do
that, but the problem is that therefore, code must be generated on the
stack that may itself be not cache-invalidated, so setting the program
counter directly is the only way I see at the moment.

Please think of it and tell me your opinion about which approach you
would take!

Thanks + best regards
Harald



More information about the Mono-devel-list mailing list