Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A modern Haskell debugger

NotificationsYou must be signed in to change notification settings

haskell-debugger/haskell-estgi-debugger

Repository files navigation

Table of Contents

  1. Introduction
  2. Overview
  3. Setup
  4. Development

Introduction

This repository contains thedap-estgi-server for Haskell debugging based on the Debug Adapter Protocol (DAP).

This library depends on two other libraries as well

Overview

Thedap-estgi-vscode-extension turns VSCode into a Haskell debugger.VSCode offers a nice debugger UI while the debugger features are provided by the External STG Interpreter DAP Server.

flowchart LRsubgraph User InterfaceA(VSCode) -.- |Plugin API| B(DAP ESTGi Extension)endB <-->|DAP via network| C(DAP ESTGi Server)subgraph DebuggerC -.- |HS library API| D(External STG Interpreter)end
Loading

Thedap-estgi-server anddap-estgi-vscode-extension are application specific components, while thedap library is designed to be application independent to support any project that needs a simple DAP framework.

Setup

  • EnableAllow breakpoints everywhere option in VSCode settings.

Install Haskell ESTGi Debugger Dependencies

  • Run(cd haskell-estgi-debugger ; stack install zip-cmd)
  • Ensurelibgmp is installed (e.g. if using homebrew,brew install gmp)

Installdap-estgi-extension

  • Run(git clone https://github.com/haskell-debugger/dap-estgi-vscode-extension; cd dap-estgi-vscode-extension ; npm install)
  • Opendap-estgi-vscode-extension folder by using theFiles/Open Folder menu.
  • Open thesrc/extension.ts file.
  • Press F5 to run the extension in a new VSCode [Extension Development Host] window.

Startdap-estgi-server

(cd dap-estgi-server ; stack run)

Note: If using Darwin OSX and you receive

external-stg-interpreter> * Missing (or bad) C library: ompexternal-stg-interpreter> This problem can usually be solved by installing the system package thatexternal-stg-interpreter> provides this library (you may need the "-dev" version). If the library isexternal-stg-interpreter> already installed but in a non-standard location then you can use the flagsexternal-stg-interpreter> --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If theexternal-stg-interpreter> library file does exist, it may contain errors that are caught by the Cexternal-stg-interpreter> compiler at the preprocessing stage. In this case you can re-run configureexternal-stg-interpreter> with the verbosity flag -v3 to see the error messages.

Try installinglibomp frombrew and then running:

$ stack run --extra-include-dirs=/usr/local/opt/libomp/include --extra-lib-dirs=/usr/local/opt/libomp/lib

Compile debuggee program with GHC-WPC using stack

  • Add the following lines to debuggee'sstack.yaml:

    # use custom ext-stg whole program compiler GHCcompiler:ghc-9.2.7compiler-check:match-exactghc-variant:wpcsetup-info:ghc:linux64-custom-wpc-tinfo6:9.2.7:url:"https://github.com/grin-compiler/foundation-pak/releases/download/ghc-9.2.7/ghc-9.2.7-x86_64-unknown-linux.tar.xz"macosx-custom-wpc:9.2.7:url:"https://github.com/grin-compiler/foundation-pak/releases/download/ghc-9.2.7/ghc-9.2.7-x86_64-apple-darwin.tar.xz"macosx-aarch64-custom-wpc:9.2.7:url:"https://github.com/grin-compiler/foundation-pak/releases/download/ghc-9.2.7/ghc-9.2.7-aarch64-apple-darwin.tar.xz"
  • Runstack buildi.e. build the provided sample hello world:(cd sample-program-to-debug ; stack build)

Open debuggee program in VSCode [Extension Development Host]

  • Open debugge project folder by using theFiles/Open Folder menu.
  • Select the debug view on the side bar
  • Click tocreate a launch.json file, then selectHaskell DAP ESTGi
  • Press F5 or thePlay button to start debugging

Development

Allow breakpoints everywhere

Rundap-estgi-extension

Startdap-estgi-server

Compile debuggee program with GHC-WPC using stack

Open debuggee program in VSCode [Extension Development Host]

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp