<p><code>mkPolicy</code> is an on-chain validator code, is lifted to template Haskell and it gets compiled to core plutus and executed when the UTXO locked by that script is spent. AFAIK, core-plutus is not Haskell, so the breakpoint will be ignored.</p>

CC BY-SA 4.0
2021-05-25T17:02:55.553Z
2021-05-25T22:16:17.250Z
2021-05-25T22:16:17.250Z
GClaramunt
<p>When I try to set a breakpoint in a small Plutus project such as <a href="https://github.com/input-output-hk/plutus-pioneer-program/tree/c1dc67e8d4e681cccd3cb83e48f8c313477305c6/code/week05" rel="noreferrer">this</a>, I always get the following error:</p>
<pre><code>:b Week05.Homework1.mkPolicy
cannot set breakpoint on Week05.Homework1.mkPolicy: module Week05.Homework1 is not interpreted
</code></pre>
<p>(Using Windows, cabal version 3.4.0.0, ghc version 8.10.4.)</p>
<p>Removing <code>-fobject-code</code> or adding <code>-fPIC</code> to the ghc-options won't help, which was suggested <a href="https://stackoverflow.com/questions/28570367/debugging-io-in-a-package-module-inside-ghci">here for other Haskell projects</a>. <code>-fPIC</code> does even fail as it is <a href="https://gcc.gnu.org/legacy-ml/gcc-patches/2015-08/msg00836.html" rel="noreferrer">not a Windows thing</a>, anyway.</p>
<p>The error is the same for off- and on-chain functions. So the <code>INLINABLE</code> pragma is not to blame.</p>
<p>Does this have anything to do with the <a href="https://iohk.io/en/blog/posts/2021/02/02/plutus-tx-compiling-haskell-into-plutus-core/" rel="noreferrer">PlutusTx compiler</a>?</p>

CC BY-SA 4.0
2021-05-25T00:49:22.810Z
This may have to do with Haskell being a functional language. Meaning that unlike imperative languages, there are no 'breakpoints' due to the nature of the language. The other link you mentioned only works with I/O operations which follow an 'imperative' style. The answer for your question would be to find a new way to debug functional programs, seeing as they don't work with imperative style debugging.
CosmicCat
<plutus><cabal><haskell><plutustx>
How do I build a debug configuration of a Plutus project?
# How do I build a debug configuration of a Plutus project?

(Asked by: username_0 on 2021-05-14)

When I try to set a breakpoint in a small Plutus project such as this, I always get the following error:
:b Week05.Homework1.mkPolicy
cannot set breakpoint on Week05.Homework1.mkPolicy: module Week05.Homework1 is not interpreted

(Using Windows, cabal version 3.4.0.0, ghc version 8.10.4.)
Removing -fobject-code or adding -fPIC to the ghc-options won't help, which was suggested here for other Haskell projects. -fPIC does even fail as it is not a Windows thing, anyway.
The error is the same for off- and on-chain functions. So the INLINABLE pragma is not to blame.
Does this have anything to do with the PlutusTx compiler?

**Tags:** plutus, cabal, haskell, plutustx
> **Comments:**
> **username_1**: This may have to do with Haskell being a functional language. Meaning that unlike imperative languages, there are no 'breakpoints' due to the nature of the language. The other link you mentioned only works with I/O operations which follow an 'imperative' style. The answer for your question would be to find a new way to debug functional programs, seeing as they don't work with imperative style debugging.  

---

## 1 answers

### Answer by username_2 on 2021-05-25. Score: 1

`mkPolicy` is an on-chain validator code, is lifted to template Haskell and it gets compiled to core plutus and executed when the UTXO locked by that script is spent. AFAIK, core-plutus is not Haskell, so the breakpoint will be ignored.


---

