
Enhancement to delve debugger for golang
- or -
Post a project like this1688
$150
- Posted:
- Proposals: 2
- Remote
- #3153995
- Awarded
Description
Experience Level: Entry
I would like to get ‘verbose’ command added to delve (https://github.com/derekparker/delve) debugger. When verbose is turned on, debugger should show execution flow of the program.
Consider my code as below (https://play.golang.org/p/vOvW4GAM0j)
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
r := rand.Intn(100)
var i int
if r%2 == 0 {
i = 2
} else {
i = 1
}
fmt.Println(i)
}
Assuming program generated odd number for variable r; I want to know how program got executed... like line13 then line15 then line17, line18 (skipping line16 as it is for even number) and so on.
I start debugging the code and set breakpoints as below
b main.main:4 // line 13 –i.e. var i int
b main.main:12 // line 21 –i.e. fmt.Println(i)
When debugger breaks at line 13, I want to turn on the verbose till it reaches line 21 (where I will turn off the verbose). When verbose is on, it should print details on screen (default) or to a file (if specified as an argument while turning on the verbose). I want line number and code at the line to get printed as well.
I also want to get value of specified variable printed if the variable exist at that stack level. For eg. if I specified variable ‘i’ then program should print “i=” at each line during the verbose is on. This feature can be considered for later enhancement.
If interested, can you please help me with your time and cost estimate for above? Feel free to ask any question doubt you may have.
Thanks
Consider my code as below (https://play.golang.org/p/vOvW4GAM0j)
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
r := rand.Intn(100)
var i int
if r%2 == 0 {
i = 2
} else {
i = 1
}
fmt.Println(i)
}
Assuming program generated odd number for variable r; I want to know how program got executed... like line13 then line15 then line17, line18 (skipping line16 as it is for even number) and so on.
I start debugging the code and set breakpoints as below
b main.main:4 // line 13 –i.e. var i int
b main.main:12 // line 21 –i.e. fmt.Println(i)
When debugger breaks at line 13, I want to turn on the verbose till it reaches line 21 (where I will turn off the verbose). When verbose is on, it should print details on screen (default) or to a file (if specified as an argument while turning on the verbose). I want line number and code at the line to get printed as well.
I also want to get value of specified variable printed if the variable exist at that stack level. For eg. if I specified variable ‘i’ then program should print “i=” at each line during the verbose is on. This feature can be considered for later enhancement.
If interested, can you please help me with your time and cost estimate for above? Feel free to ask any question doubt you may have.
Thanks

Keval S.
0% (0)Projects Completed
1
Freelancers worked with
1
Projects awarded
67%
Last project
13 Jan 2025
India
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies