#define S390_TRACE_STACK_SIZE (5*sizeof(gpointer)+4*sizeof(gdouble))
#define BREAKPOINT_SIZE sizeof(breakpoint_t)
-#define S390X_NOP_SIZE sizeof(I_Format)
+#define S390X_NOP_SIZE sizeof(RR_Format)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
breakpoint_t breakpointCode;
+static CRITICAL_SECTION mini_arch_mutex;
+
/*====================== End of Global Variables ===================*/
/*------------------------------------------------------------------*/
{
guint8 *code;
+ InitializeCriticalSection (&mini_arch_mutex);
+
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ);
bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ);
mono_mprotect (bp_trigger_page, mono_pagesize (), 0);
void
mono_arch_cleanup (void)
{
+ if (ss_trigger_page)
+ mono_vfree (ss_trigger_page, mono_pagesize ());
+ if (bp_trigger_page)
+ mono_vfree (bp_trigger_page, mono_pagesize ());
+ DeleteCriticalSection (&mini_arch_mutex);
}
/*========================= End of Function ========================*/
*/
for (i = 0; i < (BREAKPOINT_SIZE / S390X_NOP_SIZE); ++i)
s390_nop (code);
+
+ /*
+ * Add an additional nop so skipping the bp doesn't cause the ip to point
+ * to another IL offset.
+ */
+ s390_nop (code);
+
break;
}
mono_arch_is_breakpoint_event (void *info, void *sigctx)
{
siginfo_t* sinfo = (siginfo_t*) info;
- /* Sometimes the address is off by 4 */
+
+ /*
+ * Sometimes the address is off by 4
+ */
if (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128)
return TRUE;
else
void
mono_arch_skip_breakpoint (MonoContext *ctx, MonoJitInfo *ji)
{
- MONO_CONTEXT_SET_IP (ctx, (guint8*)MONO_CONTEXT_GET_IP (ctx) + BREAKPOINT_SIZE);
+ MONO_CONTEXT_SET_IP (ctx, ((guint8*)MONO_CONTEXT_GET_IP (ctx) + sizeof(RXY_Format)));
}
/*========================= End of Function ========================*/
{
siginfo_t* sinfo = (siginfo_t*) info;
- /* Sometimes the address is off by 4 */
+ /*
+ * Sometimes the address is off by 4
+ */
if (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128)
return TRUE;
else
s390_##opy (loc, r, ix, br, off); \
} else { \
if (ix == 0) { \
-fprintf(stderr,"\nS390_LONG - no index - r: %d br: %d off: %d\n",r,br,off); \
S390_SET(loc, s390_r13, off); \
s390_la (loc, s390_r13, s390_r13, br, 0); \
} else { \
-fprintf(stderr,"\nS390_LONG - index - r: %d br: %d ix: %d off: %d\n",r,br,ix,off); \
s390_la (loc, s390_r13, ix, br, 0); \
S390_SET (loc, s390_r0, off); \
s390_agr (loc, s390_r13, s390_r0); \