Skip to content

--args does not function as expected #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fritzr opened this issue May 18, 2018 · 3 comments
Closed

--args does not function as expected #194

fritzr opened this issue May 18, 2018 · 3 comments

Comments

@fritzr
Copy link
Contributor

fritzr commented May 18, 2018

Description

When running gdbgui --args .... one would expect to be able to paste the program arguments following the --args option, as with gdb. However it appears that gdbgui attempts to interpret options following --args as options to gdbgui itself instead of the inferior to debug, contrary to the text in gdbgui --help.

Steps to replicate
$ gdbgui --args `which gcc` -c test.c -o test.o
usage: gdbgui [-h] [--args ARGS [ARGS ...]] [-x GDB_CMD_FILE] [-g GDB] [--rr]
              [-p PORT] [--host HOST] [-r] [--auth-file AUTH_FILE]
              [--user USER] [--password PASSWORD] [--key KEY] [--cert CERT]
              [--license LICENSE] [--project PROJECT] [-v]
              [--hide_gdbgui_upgrades] [-n] [--debug]
              [cmd [cmd ...]]
gdbgui: error: unrecognized arguments: -c -o test.o
Environment
  • Operating system and version: Linux 2.6.32-696.23.1.el6.centos.plus.x86_64 x86_64 GNU/Linux
  • gdbgui version (gdbgui -v): 0.11.3.1
  • gdb version (gdb -v): GNU gdb (GDB) 7.8.1
  • browser: Firefox 52.7.0
  • python packages (pip freeze):
backports-abc==0.5
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.5.0.1
certifi==2017.11.5
click==6.7
decorator==4.1.2
enum34==1.1.6
Flask==0.12.4
Flask-Compress==1.4.0
Flask-SocketIO==3.0.0
funcsigs==1.0.2
gdbgui==0.11.3.1
gevent==1.3.1
greenlet==0.4.13
ipykernel==4.6.1
ipython==5.0.0
ipython-genutils==0.2.0
itsdangerous==0.24
Jinja2==2.10
jupyter-client==5.1.0
jupyter-core==4.4.0
lxml==4.2.1
manhole==1.5.0
MarkupSafe==1.0
mock==2.0.0
numpy==1.11.1
pathlib2==2.3.0
pbr==1.10.0
pdb-clone==1.10
pexpect==4.3.0
pickleshare==0.7.4
prompt-toolkit==1.0.15
protobuf==3.0.0b2
ptyprocess==0.5.2
pygdbmi==0.8.2.0
Pygments==2.2.0
python-dateutil==2.6.1
python-engineio==2.1.1
python-socketio==1.9.0
pyzmq==16.0.3
scandir==1.6
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.10.0
tornado==4.5.2
traitlets==4.3.2
wcwidth==0.1.7
Werkzeug==0.14.1
@fritzr
Copy link
Contributor Author

fritzr commented May 18, 2018

It looks like gdbgui --args "cmd args..." (with quotes around the full program string, including flags and arguments) does work. However, this is not how it is described in the usage string:

usage: gdbgui [-h] [--args ARGS [ARGS ...]] [-x GDB_CMD_FILE] [-g GDB] [--rr]
              [-p PORT] [--host HOST] [-r] [--auth-file AUTH_FILE]
              [--user USER] [--password PASSWORD] [--key KEY] [--cert CERT]
              [--license LICENSE] [--project PROJECT] [-v]
              [--hide_gdbgui_upgrades] [-n] [--debug]
              [cmd [cmd ...]]

Recommend updating the usage text to show quotes around --args "ARGS...".

@cs01
Copy link
Owner

cs01 commented May 18, 2018

Good stuff, thanks! Apologies for the inconvenience. PRs welcome if you feel up to it.

fritzr pushed a commit to fritzr/gdbgui that referenced this issue May 21, 2018
fritzr added a commit to fritzr/gdbgui that referenced this issue May 21, 2018
fritzr added a commit to fritzr/gdbgui that referenced this issue May 21, 2018
@fritzr
Copy link
Contributor Author

fritzr commented May 21, 2018

PR #198 submitted

cs01 pushed a commit that referenced this issue May 28, 2018
… program name. (#198)

* Issue #194: Change --args to match 'gdb --args'. 'cmd' now only takes program name.

* Use mutex group for --args|cmd and fix cmd to use a list type.

* Update --args help text
@cs01 cs01 closed this as completed May 28, 2018
cs01 pushed a commit that referenced this issue Jul 14, 2020
… program name. (#198)

* Issue #194: Change --args to match 'gdb --args'. 'cmd' now only takes program name.

* Use mutex group for --args|cmd and fix cmd to use a list type.

* Update --args help text
cs01 pushed a commit that referenced this issue Jul 18, 2020
… program name. (#198)

* Issue #194: Change --args to match 'gdb --args'. 'cmd' now only takes program name.

* Use mutex group for --args|cmd and fix cmd to use a list type.

* Update --args help text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants