After changing program, reload executable with file command
(gdb) file gdbprog
(gdb) run arg1 arg2 arg3...
gdb -ex=run --args executable arg1 arg2 arg3...
gdb --eval-command=run --args executable arg1 arg2 arg3...
(gdb) set args arg1 arg2 arg3...
(gdb) run
⚠️ If therun
command followed by some arguments likearg11 arg12
, the args set by theset
command will be overridden.
⚠️ Althoughset a arg1 arg2
will throw an warning of ambiguous set command "a arg1 arg2": ada, agent, annotate, architecture, args, auto-connect-native-target, auto-load..., theset arg arg1 arg2
works.
Furthermore,
set ar arg1 arg2
, Ambiguous set command "ar arg1 arg2": architecture, args.
gdb -ex "set args arg1 arg2..." -ex "r" executable
x /[Length][Format] [Address expression]
If specified, allows overriding the output format used by the command. Valid format specifiers are:
- o - octal
- x - hexadecimal
- d - decimal
- u - unsigned decimal
- t - binary
- f - floating point
- a - address
- c - char
- s - string
- i - instruction
The following size modifiers are supported:
- b - byte
- h - halfword (16-bit value)
- w - word (32-bit value)
- g - giant word (64-bit value)
(gdb) x/16bx array