Exactly as the question says: During debugging a Go binary, I want to change the value of a register. help set
in (dlv)
returns:
(dlv) help set
Changes the value of a variable.
[goroutine <n>] [frame <m>] set <variable> = <value>
See $GOPATH/src/github.com/go-delve/delve/Documentation/cli/expr.md for a description of supported expressions. Only numerical variables and pointers can be changed.
I've looked at the documentation but it sounds confusing to me. I appreciate any clarification. I simply need to change the value in a register.
The delve debugger CLI
set
command doesn't offer access to machine registers. You can only set source-code level variables. The phrase:means that some source-code variables cannot be manipulated this way, e.g., you can't call most runtime functions. For instance, even if you have
math/big
and thereforeNewInt
, you cannot use this to build a new*Int
value.