summaryrefslogtreecommitdiff
path: root/mysys/my_context.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-11-03 12:28:51 +0100
committerSergei Golubchik <sergii@pisem.net>2012-11-03 12:28:51 +0100
commit40e94a3734b1daa254810c4be64e17b84dbbc2a2 (patch)
tree5e14dfc106276445caf85dc76c8034c8b0df11b4 /mysys/my_context.c
parent247e654fa7e04dd0c5181c2241470f56749d2a99 (diff)
parent4ffc9c3b01459a2904a7154a6c750d128864fc7b (diff)
downloadmariadb-git-40e94a3734b1daa254810c4be64e17b84dbbc2a2.tar.gz
merge with 5.5
Diffstat (limited to 'mysys/my_context.c')
-rw-r--r--mysys/my_context.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/mysys/my_context.c b/mysys/my_context.c
index 1a147437c90..6b8761e554d 100644
--- a/mysys/my_context.c
+++ b/mysys/my_context.c
@@ -1,5 +1,5 @@
/*
- Copyright 2011 Kristian Nielsen and Monty Program Ab
+ Copyright 2011, 2012 Kristian Nielsen and Monty Program Ab
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -454,6 +454,15 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
(
"movl %%esp, (%[save])\n\t"
"movl %[stack], %%esp\n\t"
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+ /*
+ This emits a DWARF DW_CFA_undefined directive to make the return address
+ undefined. This indicates that this is the top of the stack frame, and
+ helps tools that use DWARF stack unwinding to obtain stack traces.
+ (I use numeric constant to avoid a dependency on libdwarf includes).
+ */
+ ".cfi_escape 0x07, 8\n\t"
+#endif
/* Push the parameter on the stack. */
"pushl %[d]\n\t"
"movl %%ebp, 4(%[save])\n\t"
@@ -483,12 +492,12 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
"3:\n\t"
"movl $1, %[ret]\n"
"4:\n"
- : [ret] "=a" (ret)
+ : [ret] "=a" (ret),
+ [f] "+c" (f),
+ [d] "+d" (d)
: [stack] "a" (c->stack_top),
/* Need this in callee-save register to preserve across function call. */
- [save] "D" (&c->save[0]),
- [f] "c" (f),
- [d] "d" (d)
+ [save] "D" (&c->save[0])
: "memory", "cc"
);