Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Conditional Debugging #1720

Closed
freman opened this issue Jun 6, 2018 · 6 comments
Closed

Conditional Debugging #1720

freman opened this issue Jun 6, 2018 · 6 comments
Labels

Comments

@freman
Copy link
Contributor

freman commented Jun 6, 2018

Hello, I have a feature request.

It would appear that the API for dlv supports conditional debugging, and it turns out you never know how much you need a feature until you don't have it.

Could we please get conditional debugging support?

https://godoc.org/github.com/derekparker/delve/service/api#Breakpoint

@lggomez
Copy link
Contributor

lggomez commented Jun 7, 2018

As you said @freman, this one was easy to implement, it was an oversight due to limitations of the legacy debug adapter API, the new one supports this scenario

You may try the feature on a build from the attached PR

@ramya-rao-a
Copy link
Contributor

@freman and others (@l33t0, @houmam, @skycube, @zenyuk, @mattevans, and @shousper) who have upvoted this feature:

Please give this feature a try by following the below steps and share any feedback you have.

@freman
Copy link
Contributor Author

freman commented Jun 11, 2018

Thanks @ramya-rao-a, I'll try to find something I need to interactively debug and test it out 😀

I did have to completely remove and re-install the plugin before it worked but...

2018/06/12 09:56:19 debugger.go:404: cleared breakpoint: &api.Breakpoint{ID:1, Name:"", Addr:0x12a05fc, File:"~/go/src/test/redis/main.go", Line:170, FunctionName:"main.main", Cond:"", Tracepoint:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(0xc42065c480), LoadLocals:(*api.LoadConfig)(0xc42065c4b0), HitCount:map[string]uint64{"1":0x1}, TotalHitCount:0x1}
2018/06/12 09:56:19 debugger.go:356: created breakpoint: &api.Breakpoint{ID:2, Name:"", Addr:0x12a05fc, File:"~/go/src/test/redis/main.go", Line:170, FunctionName:"main.main", Cond:"i == 10", Tracepoint:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(0xc42065c630), LoadLocals:(*api.LoadConfig)(0xc42065c660), HitCount:map[string]uint64{}, TotalHitCount:0x0}
2018/06/12 09:56:37 debugger.go:513: continuing
1
2
3
4
5
6
7
8
9

You have brought us so much joy! Thank you!

@l33t0
Copy link

l33t0 commented Jun 12, 2018

Thanks @ramya-rao-a works a treat!

@ramya-rao-a
Copy link
Contributor

@freman

You have brought us so much joy! Thank you!

All credits go to @lggomez :)

@ramya-rao-a
Copy link
Contributor

This feature is now available in the latest update to the Go extension (0.6.83)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants