Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug project that have some module dependency #51

Open
devxsss opened this issue Oct 11, 2020 · 5 comments
Open

How to debug project that have some module dependency #51

devxsss opened this issue Oct 11, 2020 · 5 comments

Comments

@devxsss
Copy link

devxsss commented Oct 11, 2020

I try to debug main.hs that depend on other module.
when i tried to compile in terminal such as "ghci main.hs" , it produced below

GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
[1 of 6] Compiling Queue ( Queue.hs, interpreted )
[2 of 6] Compiling Logic ( Logic.hs, interpreted )
[3 of 6] Compiling Parser ( Parser.hs, interpreted )
[4 of 6] Compiling Resolve ( Resolve.hs, interpreted )
[5 of 6] Compiling GenProof ( GenProof.hs, interpreted )
[6 of 6] Compiling Main ( main.hs, interpreted )
Ok, modules loaded: GenProof, Logic, Main, Parser, Queue, Resolve.
*Main> main
--output--

i manage to debug in main.hs but when it change to other module , nothing show up on screen . is there way to fix this?

H>>= [WARNING][REQUEST] unsupported request command. {"command":"source","arguments":{"sourceReference":0,"source":{"name":null,"path":"./Parser.hs","sourceReference":null,"origine":null}},"type":"request","seq":38}
:dap-scopes ...
H>>= :dap-variables ...

@phoityne
Copy link
Owner

Could you let me know these versions?

  • ghc
  • haskell-dap
  • ghc-dap
  • haskell-debug-adapter
  • vscode
  • which OS
  • using stack or cabal ?

(seems like using old versions.)
Regards.

@devxsss
Copy link
Author

devxsss commented Oct 12, 2020

Thankyou for the reply

The Glorious Glasgow Haskell Compilation System, version 8.8.3
haskell-dap : haskell-dap is deprecated. but it seem 0.0.14.0
ghci-dap : start ghci-dap-0.0.14.0.
haskell debug adapter :haskell-debug-adapter-0.0.33.0
vscode : 1.44.2
OS:ubuntu
phoityne-vscode --version : phoityne-vscode-0.0.28.0

I use stack and cabal

try to install haskell-debug adapter using cabal

Warning: The package list for 'hackage.haskell.org' is 92 days old.
Run 'cabal update' to get the latest list of available packages.
cabal: There is no package named 'haskell-debug-adapater'.
You may need to run 'cabal update' to get the latest list of available
packages.

i reinstalled haskell-dap, but it said deprecated.

@phoityne
Copy link
Owner

Could you remove "phoityne-vscode" and "haskell-dap" binary files ?
(currently, vscode extension uses haskell-debug-adapter and ghci-dap. installation.)

And let me know launch.json file.
Regards.

@devxsss
Copy link
Author

devxsss commented Oct 13, 2020

Thankyou for the quick reply.

Where should i remove the binary files? in the vscode folder?
this is the launch.json file

  "version": "0.2.0",
  "configurations": [
    {
      "type": "ghc",
      "request": "launch",
      "name": "haskell-debug-adapter",
      "internalConsoleOptions": "openOnSessionStart",
      "workspace": "${workspaceFolder}",
      "startup": "${workspaceFolder}/main.hs",
      "startupFunc": "",
      "startupArgs": "",
      "stopOnEntry": false,
      "mainArgs": "main",
      "ghciPrompt": "H>>= ",
      "ghciInitialPrompt": "Prelude>",
      "ghciCmd":"stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show --with-ghc=haskell-dap" ,
      "ghciEnv": {},
      "logFile": "${workspaceFolder}/.vscode/phoityne.log",
      "logLevel": "INFO",
      "forceInspect": false
    }
  ]
}

@phoityne
Copy link
Owner

Where should i remove the binary files? in the vscode folder?

It would be in the "$HOME/.local/bin".
You could find the path by this command.

$ stack exec which haskell-dap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants