From 8ad9cf8087f2d1f1badfb7c8616c0b11cc4aa6db Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 9 Feb 2012 12:26:11 -0800 Subject: rt: Add more stack-switching commentary --- src/rt/rust_task.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 6d61065d551..2902e32a439 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -732,6 +732,11 @@ rust_task::config_notify(chan_handle chan) { notify_chan = chan; } +// This is the function that switches stacks by calling another function with +// a single void* argument while changing the stack pointer. It has a funny +// name because gdb doesn't normally like to backtrace through split stacks +// (thinks it indicates a bug), but has a special case to allow functions +// named __morestack to move the stack pointer around. extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr); static uintptr_t -- cgit 1.4.1-3-g733a5