summaryrefslogtreecommitdiff
path: root/rts/StgCRun.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-08-30 14:11:56 +0200
committerBen Gamari <ben@smart-cactus.org>2015-11-01 15:19:47 +0100
commitd9f886282c605e5f4b74126b3af8f23771ef03f1 (patch)
tree5a0ed5ca4c1776b2ad7f06bebe8f43342c88ddde /rts/StgCRun.c
parent159a1a2b7501b149fadfc0cd1940fab6bf030691 (diff)
downloadhaskell-d9f886282c605e5f4b74126b3af8f23771ef03f1.tar.gz
StgStartup: Setup unwinding for stg_stop_thread
This is a bit ugly as we need to assume the structure of the C stack as left by StgRun. Nevertheless, it allows us to unwind all the way back to `_start` on my machine. ``` Stack trace: set_initial_registers (rts/Libdw.c:272.0) dwfl_thread_getframes dwfl_getthreads dwfl_getthread_frames libdw_get_backtrace (rts/Libdw.c:243.0) base_GHCziExecutionStack_getStackTrace1_info (libraries/base/GHC/ExecutionStack.hs:43.1) base_GHCziExecutionStack_showStackTrace1_info (libraries/base/GHC/ExecutionStack.hs:47.1) base_GHCziBase_bindIO1_info (libraries/base/GHC/Base.hs:1085.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) stg_catch_frame_info (rts/Exception.cmm:370.1) stg_stop_thread_info (rts/StgStartup.cmm:42.1) scheduleWaitThread (rts/Schedule.c:465.0) hs_main (rts/RtsMain.c:65.0) __libc_start_main (/tmp/buildd/glibc-2.19/csu/libc-start.c:321.0) _start ```
Diffstat (limited to 'rts/StgCRun.c')
-rw-r--r--rts/StgCRun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index 644850988e..0a010d464e 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -159,6 +159,8 @@ StgWord8 *win32AllocStack(void)
* stack isn't aligned, and calling exitWith from Haskell invokes
* shutdownHaskellAndExit using a C call.
*
+ * If you edit the sequence below be sure to update the unwinding information
+ * for stg_stop_thread in StgStartup.cmm.
*/
static void GNUC3_ATTRIBUTE(used)