[Mono-dev] [PATCH 05/12] mini: Fix unguarded uses of siginfo_t

Andreas Färber andreas.faerber at web.de
Fri Mar 26 09:29:58 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 0624c69..6bea591 100755
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,5 +1,13 @@
 2010-03-26  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-26  Andreas Faerber  <andreas.faerber at web.de>
+
 	* mini.h, mini-x86.h: Suppress sigaction for Haiku, add support for
 	BeOS-style signal handlers.
 
diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c
index e818084..f86949f 100644
--- a/mono/mini/mini-x86.c
+++ b/mono/mini/mini-x86.c
@@ -5875,6 +5875,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:
  *
@@ -5891,11 +5895,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
 }
@@ -5910,11 +5916,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.6.5.3



More information about the Mono-devel-list mailing list