On Thu, Sep 26, 2019 at 3:58 AM Stephen Illingworth < stephen.t.illingwo...@gmail.com> wrote:
> Hi all, > > I have an awkward bug I'm trying to understand and I'm missing something > in my toolbox. Is there any way of monitoring a variable for changes made > to it? For example, I have a pointer type and I want a debugger to break > whenever its value (ie. what it points to) changes. > > I call this a "watch" but I believe it's sometimes referred to as a "data > breakpoint". > > I've looked at delve and can't see anything like it. I've had a quick look > at VSCode and Goland and I can't see anything there either. Is there > anything I've missed? > I don't see anything in Delve's docs either. I'm pretty sure VSCode and Goland use Delve, so they won't work if Delve doesn't. With that said, I think gdb works to some extent with Go, and it supports "watchpoints": https://sourceware.org/gdb/current/onlinedocs/gdb/Set-Watchpoints.html#Set-Watchpoints (Note: I haven't tried debugging a go binary with gdb, so I can't do much more than point you at the manual) > > Help > > Stephen Illingworth. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/CAPmHGLPa0sgU9NkewBmZKhqVV-fZaaAni8Uaq%2BY_aUQstSEeYA%40mail.gmail.com > <https://groups.google.com/d/msgid/golang-nuts/CAPmHGLPa0sgU9NkewBmZKhqVV-fZaaAni8Uaq%2BY_aUQstSEeYA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CANrC0BiHEFJ78n7UZ6fffPq8FChH9NiFscuz-c_XpuDo%3Dhi6DQ%40mail.gmail.com.