help me reduce typing when running gdb

ramana.radhakrishnan@celunite.com ramana.radhakrishnan@celunite.com
Wed Nov 28 19:57:00 GMT 2007


> Hi, I often perform these steps:
>
> 1. bjam
> 2. gdb ./bin/debug/prog
> 3. r very long list of parameters that I hate typing
> 4. [lots of debugger commands like c, n, s, break, etc]
> 5. up arrow many times to get back to the run command w/parms
> 6. q
> 7. vi source.cpp
> 8. goto 1
>
> Can anyone recommend a way to streamline this process?  Particularly
> Step 3 and Step 5.  In MSVC, steps 1-3 is one keystroke (F5) and step 5
> is two (SHIFT-F5, F5).

Well in gdb you could put this in a command file and then source it . Look
at the source command . Or you could put it all of them in .gdbinit file
in your home directory.

You can also define your own custom commands - so run with params can be a
command that you define using define command.

Also after the first run with params , the second run always by default
takes the params you specified in the first call to run .

 So r < huge list of params>
  ...
....
... ( do lots of debug)

r

has the same effect as replacing the r with r <huge list of params>

HTH

cheers
Ramana




cheers
Ramana

>
> Thanks for your help in switching over to gdb!
>
> Chris
>




More information about the Gdb mailing list