Delve: Add support for watchpoints

Created on 18 Oct 2015  路  6Comments  路  Source: go-delve/delve

Add support for hardware / software watchpoints. Initially should only support watching a variable, but in the future should be expanded to support expressions.

  • Watch a variable and break when the program reads it.
  • Watch a variable and break when program writes it.
  • Combination of both above.
areapi areproc kindesign kindiscussion kinenhancement

Most helpful comment

Watchpoints are the reason I use a debugger at all. They are invaluable. If possible, please prioritize them.

All 6 comments

Any update on this? Is there a different thread I can follow along with?

Watchpoints are the reason I use a debugger at all. They are invaluable. If possible, please prioritize them.

Especially setting watchpoints on channels would be really useful to follow execution flow.

I have a question here: are hardware watchpoints realized by CPU debug registers DR0 ~ DR3 on amd64?

Especially setting watchpoints on channels would be really useful to follow execution flow.

Writing to a channel is actually converted into a function call, so it would just be a regular conditional breakpoint on runtime.chansend/runtime.chanrecv (however it is currently impossible to write the appropriate condition).

I have a question here: are hardware watchpoints realized by CPU debug registers DR0 ~ DR3 on amd64?

Yes, however things are complicated substantially by stack resize operations.

Hi. Is this being working on ? Right now I've found during VSCode + dlv debugging, I can see the watched variables' value, but can't see the program is stopped when the watched variables are changed, which seems not to match watch semantics. Better to behave like gdb watch

Was this page helpful?
0 / 5 - 0 ratings