02-26-05 10:53 PM
Henry Townsend <henry.townsend@not.here> writes:
> Unfortunately I've found that the following does not work:
>
> gdb --args FOO=bar program args ...
According to 'info gdb', this is supposed to perform:
execlp("FOO=bar", "FOO=bar", "program", "args", ..., NULL);
Assuming you don't have and executable named 'FOO=bar', it is not
supposed to work.
Your confusion probably comes from the fact that at the bash prompt
"FOO=bar program args" does work, but that's because bash recognizes
this as a special case, and essentially (but not literally) performs
exec("env FOO=bar program args")
You might argue that gdb should recognize this as a special case
as well, but IMHO gdb is already doing too much argument
interpretation (e.g. it always invokes the inferior with full path,
instead of what I actually gave it).
To solve your problem, use the .gdbinit, as Russell Shaw suggested.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
[ Post a follow-up to this message ]
|