[Mono-dev] [PATCH 2/8] mini: Fix unguarded uses of siginfo_t

Andreas Färber andreas.faerber at web.de
Wed Mar 31 20:27:53 EDT 2010


Haiku does not support SA_SIGINFO-style signal handlers including the
siginfo_t type.

This commit is licensed under the MIT X11 license.
---
 mono/mini/ChangeLog  |    8 ++++++++
 mono/mini/mini-x86.c |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index 4c844b0..9045381 100755
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-30  Andreas Faerber  <andreas.faerber at web.de>
+
+	* mini-x86.c (mono_arch_is_single_step_event,
+	mono_arch_is_breakpoint_event): New define HAVE_SIG_INFO,
+	restrict it to MONO_ARCH_USE_SIGACTION to fix build on Haiku.
+
+	Code is contributed under MIT/X11 license.
+
 2010-03-30 Rodrigo Kumpera  <rkumpera at novell.com>
 
 	* mini-exceptions.c: Introduce mono_walk_stack_full, which
diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c
index 1911501..94b72b4 100644
--- a/mono/mini/mini-x86.c
+++ b/mono/mini/mini-x86.c
@@ -5919,6 +5919,10 @@ mono_arch_stop_single_stepping (void)
 	mono_mprotect (ss_trigger_page, mono_pagesize (), MONO_MMAP_READ);
 }
 
+#if defined(MONO_ARCH_USE_SIGACTION)
+#define HAVE_SIG_INFO
+#endif
+
 /*
  * mono_arch_is_single_step_event:
  *
@@ -5935,11 +5939,13 @@ mono_arch_is_single_step_event (void *info, void *sigctx)
 	else
 		return FALSE;
 #else
+#ifdef HAVE_SIG_INFO
 	siginfo_t* sinfo = (siginfo_t*) info;
 	/* Sometimes the address is off by 4 */
 	if (sinfo->si_signo == DBG_SIGNAL && (sinfo->si_addr >= ss_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)ss_trigger_page + 128))
 		return TRUE;
 	else
+#endif
 		return FALSE;
 #endif
 }
@@ -5954,11 +5960,13 @@ mono_arch_is_breakpoint_event (void *info, void *sigctx)
 	else
 		return FALSE;
 #else
+#ifdef HAVE_SIG_INFO
 	siginfo_t* sinfo = (siginfo_t*)info;
 	/* Sometimes the address is off by 4 */
 	if (sinfo->si_signo == DBG_SIGNAL && (sinfo->si_addr >= bp_trigger_page && (guint8*)sinfo->si_addr <= (guint8*)bp_trigger_page + 128))
 		return TRUE;
 	else
+#endif
 		return FALSE;
 #endif
 }
-- 
1.7.0.3



More information about the Mono-devel-list mailing list