Skip to content

Commit d6055b2

Browse files
committed
Issue cs01#194: Change --args to match 'gdb --args'. 'cmd' now only takes program name.
1 parent 71e669d commit d6055b2

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

gdbgui/backend.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -765,18 +765,6 @@ def main():
765765
security = parser.add_argument_group(title="security settings")
766766
other = parser.add_argument_group(title="other settings")
767767

768-
gdb_group.add_argument(
769-
"cmd",
770-
nargs="*",
771-
help="The binary and arguments to run in gdb. Example: './mybinary myarg -flag1 -flag2'",
772-
default=[],
773-
)
774-
gdb_group.add_argument(
775-
"--args",
776-
nargs="+",
777-
help='Alias for cmd argument above. Example: gdbgui --args "./mybinary myarg -flag1 -flag2"',
778-
default=[],
779-
)
780768
gdb_group.add_argument(
781769
"-x", "--gdb_cmd_file", help="Execute GDB commands from file."
782770
)
@@ -858,12 +846,36 @@ def main():
858846
help="By default, the browser will open with gdbgui. Pass this flag so the browser does not open.",
859847
action="store_true",
860848
)
849+
other.add_argument(
850+
"-b",
851+
"--browser",
852+
help="Use the given browser executable instead of the system default.",
853+
default=None,
854+
)
861855
other.add_argument(
862856
"--debug",
863857
help="The debug flag of this Flask application. "
864858
"Pass this flag when debugging gdbgui itself to automatically reload the server when changes are detected",
865859
action="store_true",
866860
)
861+
862+
gdb_group.add_argument(
863+
"--args",
864+
nargs=argparse.REMAINDER,
865+
help='All remaining args are taken as the binary and arguments to run'
866+
' in gdb (as with gdb --args).'
867+
' Example: gdbgui [...] --args ./mybinary myarg -flag1 -flag2',
868+
default=[],
869+
)
870+
gdb_group.add_argument(
871+
"cmd",
872+
nargs='?',
873+
help='Name of the binary to run in gdb. To pass flags to the binary,'
874+
' use --args.'
875+
' Example: gdbgui ./mybinary [gdbgui-args...]',
876+
default=[],
877+
)
878+
867879
args = parser.parse_args()
868880

869881
initialize_preferences()

0 commit comments

Comments
 (0)