help me reduce typing when running gdb
Tom Tromey
tromey@redhat.com
Thu Nov 29 00:03:00 GMT 2007
>>>>> "Chris" == Chris Stankevitz <cstankevitz@toyon.com> writes:
In addition to what everybody else said...
Chris> 2. gdb ./bin/debug/prog
Chris> 3. r very long list of parameters that I hate typing
Here I frequently use:
gdb --args ./bin/debug/prog lots of parameters
This works nicely unless you have to redirect input or output.
Chris> 6. q
Don't quit. Edit your source, rebuild, and then in gdb just 'r'.
It will reuse the arguments and will re-read the updated executable.
This isn't always foolproof. For instance, if your OS has address
space randomization, and you have a watchpoint installed, you will
have to delete the watchpoint. (If you're doing a lot of difficult
debugging, find out how to disable randomization.)
If you are an Emacs user, run gdb in Emacs.
Tom
More information about the Gdb
mailing list