How to pass google command line flags as an argument to GDB

573 Views Asked by At

I understand that to pass an argument to a gdb program I can run

r arg1 arg2 arg3

But I want to pass a GFLAG which has a name associated with an argument. Something like

r arg1="hi" arg2="there"
1

There are 1 best solutions below

0
Employed Russian On BEST ANSWER

I want to pass a GFLAG which has a name associated with an argument.

What's stopping you?

This works:

gdb --args /path/to/binary --flag1=foo --flag2=bar --flag3="hi there"

So does this:

(gdb) run --flag1=foo --flag2=bar --flag3="hi there"
(gdb) run --flag1 foo --flag2 bar --flag3 "hi there"