Feature req: list / edit current args
thockin opened this issue · comments
- What version of Delve are you using (
dlv version
)?
Delve Debugger
Version: 1.21.1
Build:
- What version of Go are you using? (
go version
)?
go version go1.21.3 linux/amd64
- What operating system and processor architecture are you using?
linux amd64
- What did you do?
Ran dlv with lots of pass-thru arguments, but needed to change one. Could not figure out how.
- What did you expect to see?
A way
- What did you see instead?
No way
I ran dlvs as dlv debug ./pkg -- <lots of args>
. I set up a bunch of breakpoints and then realized I got one arg wrong. I can r
with the same args, or r <new args>
but I can't easily list the current args so I can edit them. Instead I have to drop out of dlv to fetch them and restart with new args. Even just a way to print them in dlv, so I can cut-paste into a new r
?
You can see the arguments for the current process by either printing os.Args (p os.Args
) or by using target list
.
PS. I should point out that the latter doesn't always work on macos (you can't see the command line of a process you attached to), but that's because of a limitation of debugserver which we can't do anything about.
ok, looking at os.Args is clever.