Changes between Version 5 and Version 6 of Debugging/CompiledCode


Ignore:
Timestamp:
May 9, 2011 9:21:36 PM (3 years ago)
Author:
dterei
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debugging/CompiledCode

    v5 v6  
    4848   with the non-threaded runtime). 
    4949 
    50  * Use runtime debugging options to help narrow down the fault (see also the [http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html#rts-options-debugging  relevant User Manual section]). 
     50 * Use runtime debugging options to help narrow down the fault (see also the [http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html#rts-options-debugging relevant User Manual section]). 
    5151 
    5252 * Grab our [attachment:".gdbinit" gdb macros]. 
     
    146146 
    147147Symbols in GHC are encoded using something called the Z-encoding (see 
    148 [http://darcs.haskell.org/ghc/compiler/utils/Encoding.hs Encoding.hs]).  Basically special symbols are replaced by sequences 
     148[[GhcFile(compiler/utils/Encoding.hs)]].  Basically special symbols are replaced by sequences 
    149149beginning with {{{z}}} or {{{Z}}}.  eg. {{{state#}}} becomes 
    150150{{{statezh}}}.  The letter {{{z}}} itself is replaced by {{{zz}}}. 
     
    160160||{{{fast}}}||a primitive|| 
    161161 
    162 (see [http://darcs.haskell.org/ghc/compiler/cmm/CLabel.hs CLabel.hs] 
     162(see [[GhcFile(compiler/cmm/CLabel.hs)]] 
    163163for a table of these).  Note that if you're matching up assembly with 
    164164C-- and (info) tables next to code is enabled (as it is by default), 
     
    187187 
    188188You can display memory in gdb with something like {{{x/4a}}} to 
    189 display 4 words of memory, or using our [attachment:".gdbinit" gdb macros] you get slighty 
     189display 4 words of memory, or using our [attachment:".gdbinit" gdb macros] you get slightly 
    190190nicer output: 
    191191 
     
    233233of jumping to the entry code for a closure can be done with a single 
    234234indirection).  The layout of info tables is defined in 
    235 [http://darcs.haskell.org/ghc/includes/rts/storage/InfoTables.h InfoTables.h]. 
     235[[GhcFile(includes/rts/storage/InfoTables.h)]]. 
    236236 
    237237To display the stack, you need to know what the {{{Sp}}} register is 
     
    278278The {{{type}}} field tells us what kind of object this is, in this 
    279279case {{{36}}}}, which means a {{{RET_SMALL}}} stack frame (see 
    280 [http://darcs.haskell.org/ghc/includes/rts/storage/ClosureTypes.h ClosureTypes.h] 
     280[[GhcFile(includes/rts/storage/ClosureTypes.h)]] 
    281281for a list of closure types, but make sure you are 
    282282looking at the right version of this file for the build you're using, 
     
    316316fragment you're looking at, you need to look at the STG intermediate 
    317317code generated by GHC.  Use the {{{-ddump-stg}}} flag.  The reason we 
    318 have to look at the STG is becase this is the last phase before code 
     318have to look at the STG is because this is the last phase before code 
    319319generation, after all the transformations have happened, and the 
    320320symbol names in STG correspond pretty directly to the symbols you see