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

Harald Krapfenbauer krapfenbauer at ict.tuwien.ac.at
Mon Jul 14 08:50:19 EDT 2008


Fortunately, the Mips-Linux guys verified that ptrace POKETEXT calls
ensure I-cache coherency and consistency, so for the debugger, it's not
necessary to take care of caching.

Best regards,
Harald


Harald Krapfenbauer wrote:
> 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
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-- 
Harald Krapfenbauer
Project assistant

Vienna University of Technology, Institute of Computer Technology
Gusshausstraße 27-29, 1040 Vienna, Austria
Phone: +43-1-58801-38472, Fax: +43-1-58801-38499
Email: krapfenbauer at ict.tuwien.ac.at, WWW: http://www.ict.tuwien.ac.at
Skype: harald.krapfenbauer


More information about the Mono-devel-list mailing list