diff options
author | Peter Wortmann <scpmw@leeds.ac.uk> | 2014-10-14 01:14:14 +0200 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-12-16 15:02:36 -0600 |
commit | 711a51adcf8b32801289478443549947eedd49a2 (patch) | |
tree | 997097cefce231c5685a9ce269289bf78b2843ab /rts/Exception.cmm | |
parent | 5fecd767309f318e0ec6797667ca6442a54ea451 (diff) | |
download | haskell-711a51adcf8b32801289478443549947eedd49a2.tar.gz |
Add unwind information to Cmm
Unwind information allows the debugger to discover more information
about a program state, by allowing it to "reconstruct" other states of
the program. In practice, this means that we explain to the debugger
how to unravel stack frames, which comes down mostly to explaining how
to find their Sp and Ip register values.
* We declare yet another new constructor for CmmNode - and this time
there's actually little choice, as unwind information can and will
change mid-block. We don't actually make use of these capabilities,
and back-end support would be tricky (generate new labels?), but it
feels like the right way to do it.
* Even though we only use it for Sp so far, we allow CmmUnwind to specify
unwind information for any register. This is pretty cheap and could
come in useful in future.
* We allow full CmmExpr expressions for specifying unwind values. The
advantage here is that we don't have to make up new syntax, and can e.g.
use the WDS macro directly. On the other hand, the back-end will now
have to simplify the expression until it can sensibly be converted
into DWARF byte code - a process which might fail, yielding NCG panics.
On the other hand, when you're writing Cmm by hand you really ought to
know what you're doing.
(From Phabricator D169)
Diffstat (limited to 'rts/Exception.cmm')
-rw-r--r-- | rts/Exception.cmm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/Exception.cmm b/rts/Exception.cmm index e03d53e1d5..5007ef3c0c 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -58,6 +58,7 @@ import ghczmprim_GHCziTypes_True_closure; INFO_TABLE_RET(stg_unmaskAsyncExceptionszh_ret, RET_SMALL, W_ info_ptr) /* explicit stack */ { + unwind Sp = Sp + WDS(1); CInt r; P_ ret; |