This patch extends the base library with a new Haskell module called GHC.ExecutionStack. Essentially it provides the simple functions to print a stack trace to stdout. As the module name suggests, it uses GHC-specific implementation details to retrieve a stack. In particular it uses the stg stack.
The usefulness of the printed stack is currently low. As it is only using names from the symbol table, which most of the time are just random (something like "s2cZ_info"). But you can sometimes get useful names in the stack trace still (like "Main_myfunction_info"), so it is still useful when debugging. See the module documentation for an example when it could print something useful.