Skip to content
Snippets Groups Projects
Commit bd85d963 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Ben Gamari
Browse files

Fix a debug print in disassembler (#14905)

When interpreter is not profiled (see `interpreterProfiled` in
`DynFlags`) bytecode generator generates a NULL pointer as the cost
centre of a `BRK_FUN` instruction:

    let cc | interpreterProfiled dflags = cc_arr ! tick_no
           | otherwise = toRemotePtr nullPtr
    let breakInstr = BRK_FUN (fromIntegral tick_no) (getUnique this_mod) cc
    return $ breakInstr `consOL` code

We now take this into account when disassembling `BRK_FUN`.

Reviewers: bgamari, simonmar, erikd

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4490

(cherry picked from commit 8e341013)
parent 161467c1
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,11 @@ disInstr ( StgBCO *bco, int pc ) ...@@ -68,7 +68,11 @@ disInstr ( StgBCO *bco, int pc )
case bci_BRK_FUN: case bci_BRK_FUN:
debugBelch ("BRK_FUN " ); printPtr( ptrs[instrs[pc]] ); debugBelch ("BRK_FUN " ); printPtr( ptrs[instrs[pc]] );
debugBelch (" %d ", instrs[pc+1]); printPtr( ptrs[instrs[pc+2]] ); debugBelch (" %d ", instrs[pc+1]); printPtr( ptrs[instrs[pc+2]] );
debugBelch(" %s\n", ((CostCentre*)(literals[instrs[pc+3]]))->label); CostCentre* cc = (CostCentre*)literals[instrs[pc+3]];
if (cc) {
debugBelch(" %s", cc->label);
}
debugBelch("\n");
pc += 4; pc += 4;
break; break;
case bci_SWIZZLE: case bci_SWIZZLE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment