Wednesday, February 28, 2018

GUI for Delve Debugger Gdlv

What is Gdlv?
Gdlv is a graphical interface to Delve for Linux, Windows and macOS. Previously, I posted Delve debugger in console mode Debugging Go programs with Delve 
and now, I would like to introduce the graphical delve debugger.


Implementation
First make sure you have the latest version of delve installed:
go get -u github.com/derekparker/delve/cmd/dlv

then install gdlv:
go get -u github.com/aarzilli/gdlv

To start gdlv can be done by opening command prompt (cmd) then type command
gdlv debug main.go
and it will show GUI of delve debugger as shown as below



You can open other new window by clicking drop down box for example Globals window, Sources window, etc
 

Now, let us add break-point at line 7 by using command break main.go:7 shown as picture below. You can add break-point too by right click the line code and Set breakpoint.
To clear break-point, can be done by right click and select Clear breakpoint.


By opening new window sources then find your file source code by typing the filename. In my case, the filename is main.go and double click to open the file. You will see the break-point at line 6 and 7.


Type command continue and debugger will stop at line 6


 By giving command next, it will go to next break point.
 Command in Gdlv is the same command with Dlv.

Thank you





Other topics:










No comments:

Post a Comment