delve
delve copied to clipboard
Allow users to show the arguments of current debugged like gdb `show args`
Now dlv has no method to show the arguments of current debugged program in the dlv interactive cmd.
Can we add a command to show current running arguments like gdb show args
?
p os.Args
will do this
Seems p os.Args
can't do this?
p os.Args
will do this
=== updated ==
p os.Args
works after run to a breakpoint.
another problem with p os.Args
is that the program should be running, otherwise it reports this (dlv) p os.Args Process 23179 has exited with status 0
os.Args needs to be initialized by the go runtime so it won't be available immediately after starting a program. Also, as you note, you can't read it after the program has quit. But features have a complexity cost and I don't think it's worth paying it to cover this edge cases.
To run 'p os.Args' at breakpoint 'main.main' may meet your needs. @llhuii