... | ... | @@ -208,7 +208,7 @@ nicer output: |
|
|
the bottom. In this case I'm displaying memory pointed to by the
|
|
|
register `rbx`, which corresponds to the STG register `R1` on
|
|
|
a recent x86_64 build. Check
|
|
|
[ MachRegs.h](http://darcs.haskell.org/ghc/includes/MachRegs.h) to
|
|
|
[ MachRegs.h](http://darcs.haskell.org/ghc/includes/stg/MachRegs.h) to
|
|
|
see which machine registers correspond to which STG registers on your
|
|
|
platform.
|
|
|
|
... | ... | @@ -218,7 +218,7 @@ closure for the `Int` value 5. Closures always consist of an info |
|
|
pointer (`GHCziBase_Izh_con_info` in this case, the `I#`
|
|
|
constructor), followed by any number of payload words (just one word
|
|
|
containing the value 5, here). Full details on closure layouts are in
|
|
|
[ Closures.h](http://darcs.haskell.org/ghc/includes/Closures.h).
|
|
|
[ Closures.h](http://darcs.haskell.org/ghc/includes/rts/storage/Closures.h).
|
|
|
|
|
|
|
|
|
It looks like the next word contains garbage, probably because it is
|
... | ... | @@ -243,7 +243,7 @@ execution. The *info pointer* of a closure actually points to the |
|
|
entry code (this is a trick used by GHC so that the common operation
|
|
|
of jumping to the entry code for a closure can be done with a single
|
|
|
indirection). The layout of info tables is defined in
|
|
|
[ InfoTables.h](http://darcs.haskell.org/ghc/includes/InfoTables.h).
|
|
|
[ InfoTables.h](http://darcs.haskell.org/ghc/includes/rts/storage/InfoTables.h).
|
|
|
|
|
|
|
|
|
To display the stack, you need to know what the `Sp` register is
|
... | ... | @@ -293,7 +293,7 @@ $5 = {srt_offset = 4241688, __pad_srt_offset = 6684481, i = {layout = { |
|
|
|
|
|
The `type` field tells us what kind of object this is, in this
|
|
|
case `36`}, which means a `RET_SMALL` stack frame (see
|
|
|
[ ClosureTypes.h](http://darcs.haskell.org/ghc/includes/ClosureTypes.h)
|
|
|
[ ClosureTypes.h](http://darcs.haskell.org/ghc/includes/rts/storage/ClosureTypes.h)
|
|
|
for a list of closure types, but make sure you are
|
|
|
looking at the right version of this file for the build you're using,
|
|
|
because the types do change).
|
... | ... | |