summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2007-04-27 19:26:18 +0000
committerroot <root>2007-04-27 19:26:18 +0000
commit98929e8018371c8847c69ea1ed8e88f82b5df83a (patch)
tree7f8ddfc5d04af99cd15e400b82a69c0ea0bd1201
parent7966454a8d0a4252e31d883b7aaaa0f1a0d1c197 (diff)
*** empty log message ***
-rw-r--r--coro.c12
-rw-r--r--coro.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/coro.c b/coro.c
index b297aa3..d02c4db 100644
--- a/coro.c
+++ b/coro.c
@@ -67,6 +67,12 @@ static volatile coro_func coro_init_func;
static volatile void *coro_init_arg;
static volatile coro_context *new_coro, *create_coro;
+/* what we really want to detect here is wether we use a new-enough version of GAS */
+/* instead, check for gcc 3 and ELF and hope for the best */
+#if __GNUC__ >= 3 && __ELF__
+# define HAVE_CFI 1
+#endif
+
static void
coro_init (void)
{
@@ -75,7 +81,13 @@ coro_init (void)
coro_transfer ((coro_context *)new_coro, (coro_context *)create_coro);
+#if HAVE_CFI
+ asm (".cfi_startproc");
+#endif
func ((void *)arg);
+#if HAVE_CFI
+ asm (".cfi_endproc");
+#endif
/* the new coro returned. bad. just abort() for now */
abort ();
diff --git a/coro.h b/coro.h
index 788810f..0293293 100644
--- a/coro.h
+++ b/coro.h
@@ -39,6 +39,7 @@
* 2006-10-26 Include stddef.h on OS X to work around one of its bugs.
* Reported by Michael_G_Schwern.
* 2006-11-26 Use _setjmp instead of setjmp on GNU/Linux.
+ * 2007-04-27 Set unwind frame info if gcc 3+ and ELF is detected.
*/
#ifndef CORO_H