Skip to content

Commit 66e4cea

Browse files
committed
Questions
1 parent 85cdda7 commit 66e4cea

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

haskell-debugger/GHC/Debugger/Monad.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ runDebugger l rootDir compDir libdir units ghcInvocation' extraGhcArgs mainFp co
342342
mainGhcThread :: Ghc a
343343
mainGhcThread = do
344344
-- Initializes interpreter!
345+
-- FIXME: Do these affect affect the loading of the debugee code? and which ones are required?
346+
--
347+
-- I guess these are important for it to be debuggable?
348+
-- `GHC.gopt_set` GHC.Opt_IgnoreOptimChanges
349+
-- `GHC.gopt_set` GHC.Opt_IgnoreHpcChanges
350+
-- `GHC.gopt_set` GHC.Opt_UseBytecodeRatherThanObjects
351+
-- `GHC.gopt_set` GHC.Opt_InsertBreakpoints
345352
_ <- GHC.setSessionDynFlags dflags2
346353

347354
-- Initialise plugins here because the plugin author might already expect this

hdb/Development/Debug/Adapter/Init.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ initDebugger l supportsRunInTerminal preferInternalInterpreter
142142
| otherwise -> mempty
143143

144144
liftIO (runExceptT (hieBiosSetup hieBiosLogger projectRoot entryFile)) >>= \case
145-
Left e -> throwError $ InitFailed e
146-
Right (Left e) -> lift $ terminateWithError e
145+
-- FIXME: why are these errors handled differently?
146+
Left e -> throwError $ InitFailed e -- errors while checking ghc version
147+
-- FIXME: will crash calling destroyDebugSession, since we haven't registered one yet.
148+
Right (Left e) -> lift $ terminateWithError e -- errors while getting flags.
149+
147150
Right (Right flags) -> do
148151

149152
let

0 commit comments

Comments
 (0)