Skip to content

callmekohei/tigaDebugger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT-LICENSE Gitter

alt text

tigaDebugger

tigaDebugger is a tiny debugger for F#.

Requires

vim ( above version 8, +python3, +terminal )
sdb
sdbplg

Install

// download
$ git clone --depth 1 https://github.com/callmekohei/tigaDebugger
$ git clone --depth 1 https://github.com/roxma/nvim-yarp
$ git clone --depth 1 https://github.com/roxma/vim-hug-neovim-rpc

// install neovim plugins
$ pip3 install neovim

// set runtimepath
$ vim .vimrc

    set runtimepath+=/path/to/tigaDebugger
    set runtimepath+=/path/to/nvim-yarp
    set runtimepath+=/path/to/vim-hug-neovim-rpc

Setting

01 - change readline for stable running

$ brew install readline
$ vim /usr/local/lib/sdb/sdb.exe.config
<configuration>
    <dllmap dll="libedit" target="libedit.so.2" os="!windows" />
    <dllmap dll="libedit" target="/usr/local/Cellar/readline/7.0.3_1/lib/libreadline.dylib" os="osx" />
</configuration>

02 - ambiwidth is single

" vimrc
set ambiwidth=single

Usage

// write fsharp code
$ vim foo.fsx

    let foo() =
        let mutable x = 1
        x <- 2
        x <- 3
        x

    foo ()
    |> stdout.WriteLine


// compile file
$ fsharpc -g --optimize- foo.fsx

// open file
$ vim foo.fsx

// start debug mode
: TigaSetDebugger sdb
: Tiga foo.exe

// set break point
: TigaCommand bp add at foo.fsx 3

// run
: TigaCommand r

// next
: TigaCommand n

// quit debug mode
: TigaQuit

Shortcut Keys

Press To
ctrl b Add or delete Breakpoint
ctrl d Delete all breakpoints
ctrl r Run
ctrl k Kill (Break)
ctrl p Replace watch variable
ctrl y Add watch variable
ctrl t Delete watch variable
ctrl n Step over ( Next )
ctrl i Step In
ctrl u Step out ( Up )
ctrl c Continue

About Compile

--optimize- parameter is required.

// create exe file
$ fsharpc -g --optimize- foo.fsx

// create dll file
$ fsharpc -a -g --optimize- foo.fsx

About Top-Level variables

see also: about top-level variables

Top-Level varibables needs full namespaces.

// file name is foo.fsx
module Bar =
    let mutable x = "hello"
    x <- "world"
    stdout.WriteLine(x)

tiga command

: TigaWatchAdd Foo.Bar.x

result

─── Expressions ─────────────────
No locals
#0 'Foo.Bar.x':string it = "hello"

About terminal buffer mode

Terminal buffer must have either a Terminal-Job or Terminal-Normal mode.

vim help

: help Terminal-mode

Terminal-Job mode

'i' or 'a'

Terminal-Normal mode ( enable to scroll )

CTRL-w N

Releases

No releases published

Packages

No packages published