Hello Zoltan,

Am 02.04.2010 um 03:16 schrieb Zoltan Varga:

  This looks ok.

Thinking about it, does it make sense to patch the functions in this way? Without siginfo_t, the functions would always return FALSE so we would apparently never get single step or breakpoint events then.

Might it be a better idea to just undef MONO_ARCH_SOFT_DEBUG_SUPPORTED in mini-x86.h instead to keep `mono -V` from pretending it works?

Andreas

On Thu, Apr 1, 2010 at 2:27 AM, Andreas Färber <[email protected]> wrote:
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  <[email protected]>
+
+       * 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  <[email protected]>

       * 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

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to