go-delve / delve

Delve is a debugger for the Go programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature req: list / edit current args

thockin opened this issue · comments

  1. What version of Delve are you using (dlv version)?

Delve Debugger
Version: 1.21.1
Build: $Id: a358c02f24aa7047ecc562b0587dc2d08330b2cf $

  1. What version of Go are you using? (go version)?

go version go1.21.3 linux/amd64

  1. What operating system and processor architecture are you using?

linux amd64

  1. What did you do?

Ran dlv with lots of pass-thru arguments, but needed to change one. Could not figure out how.

  1. What did you expect to see?

A way

  1. 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.