This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug server/21981] New: Document on --help and man that gdbserver --multi can take the program and CLI arguments as arguments
- From: "ciro.santilli at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 20 Aug 2017 11:33:12 +0000
- Subject: [Bug server/21981] New: Document on --help and man that gdbserver --multi can take the program and CLI arguments as arguments
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21981
Bug ID: 21981
Summary: Document on --help and man that gdbserver --multi can
take the program and CLI arguments as arguments
Product: gdb
Version: 7.11
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: server
Assignee: unassigned at sourceware dot org
Reporter: ciro.santilli at gmail dot com
Target Milestone: ---
gdbserver --help says:
Usage: gdbserver [OPTIONS] COMM PROG [ARGS ...]
gdbserver [OPTIONS] --attach COMM PID
gdbserver [OPTIONS] --multi COMM
however it should likely be:
gdbserver [OPTIONS] --multi COMM [PROG [ARGS ...]]
since --multi can take either PROG or ARGS:
gdbserver --multi :1234 ./prog.out a b
gdb -ex 'target extended-remote :1234' ./prog.out
Then:
(gdb) b main
(gdb) c
(gdb) show args
Argument list to give program being debugged when it is started is ""
(gdb) print argc
$1 = 3
and that behavior is very useful (you can have a single alias that either runs
the program without GDB, or appends "gdbserver" before the command).
The only annoyance is that the arguments only work for the first run, unlike an
explicit "set args" on host, but maybe that should be solved with:
https://sourceware.org/bugzilla/show_bug.cgi?id=21980
--
You are receiving this mail because:
You are on the CC list for the bug.