+ mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
+ g_assert (code - buf <= tramp_size);
+
+ *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
+
+ return buf;
+}
+
+guint8*
+mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
+{
+ guint8 *buf, *code;
+ GSList *unwind_ops = NULL;
+ MonoJumpInfo *ji = NULL;
+ int frame_size;
+
+ buf = code = mono_global_codeman_reserve (96);
+
+ /*
+ * Construct the MonoContext structure on the stack.
+ */
+
+ frame_size = sizeof (MonoContext);
+ frame_size = ALIGN_TO (frame_size, MONO_ARCH_FRAME_ALIGNMENT);
+ ARM_SUB_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, frame_size);
+
+ /* save ip, lr and pc into their correspodings ctx.regs slots. */
+ ARM_STR_IMM (code, ARMREG_IP, ARMREG_SP, MONO_STRUCT_OFFSET (MonoContext, regs) + sizeof (mgreg_t) * ARMREG_IP);
+ ARM_STR_IMM (code, ARMREG_LR, ARMREG_SP, MONO_STRUCT_OFFSET (MonoContext, regs) + 4 * ARMREG_LR);
+ ARM_STR_IMM (code, ARMREG_LR, ARMREG_SP, MONO_STRUCT_OFFSET (MonoContext, regs) + 4 * ARMREG_PC);
+
+ /* save r0..r10 and fp */
+ ARM_ADD_REG_IMM8 (code, ARMREG_IP, ARMREG_SP, MONO_STRUCT_OFFSET (MonoContext, regs));
+ ARM_STM (code, ARMREG_IP, 0x0fff);
+
+ /* now we can update fp. */
+ ARM_MOV_REG_REG (code, ARMREG_FP, ARMREG_SP);
+
+ /* make ctx.esp hold the actual value of sp at the beginning of this method. */
+ ARM_ADD_REG_IMM8 (code, ARMREG_R0, ARMREG_FP, frame_size);
+ ARM_STR_IMM (code, ARMREG_R0, ARMREG_IP, 4 * ARMREG_SP);
+ ARM_STR_IMM (code, ARMREG_R0, ARMREG_FP, MONO_STRUCT_OFFSET (MonoContext, regs) + 4 * ARMREG_SP);
+
+ /* make ctx.eip hold the address of the call. */
+ ARM_SUB_REG_IMM8 (code, ARMREG_LR, ARMREG_LR, 4);
+ ARM_STR_IMM (code, ARMREG_LR, ARMREG_FP, MONO_STRUCT_OFFSET (MonoContext, pc));
+
+ /* r0 now points to the MonoContext */
+ ARM_MOV_REG_REG (code, ARMREG_R0, ARMREG_FP);
+
+ /* call */
+ // FIXME: AOT