Skip to content

Commit f5a8abd

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

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

gdbgui/backend.py

+18-12
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
)
@@ -864,6 +852,24 @@ def main():
864852
"Pass this flag when debugging gdbgui itself to automatically reload the server when changes are detected",
865853
action="store_true",
866854
)
855+
856+
gdb_group.add_argument(
857+
"--args",
858+
nargs=argparse.REMAINDER,
859+
help='All remaining args are taken as the binary and arguments to run'
860+
' in gdb (as with gdb --args).'
861+
' Example: gdbgui [...] --args ./mybinary myarg -flag1 -flag2',
862+
default=[],
863+
)
864+
gdb_group.add_argument(
865+
"cmd",
866+
nargs='?',
867+
help='Name of the binary to run in gdb. To pass flags to the binary,'
868+
' use --args.'
869+
' Example: gdbgui ./mybinary [gdbgui-args...]',
870+
default=[],
871+
)
872+
867873
args = parser.parse_args()
868874

869875
initialize_preferences()

0 commit comments

Comments
 (0)