help me reduce typing when running gdb

Michael Snyder msnyder@specifix.com
Wed Nov 28 20:22:00 GMT 2007


On Wed, 2007-11-28 at 11:43 -0800, Chris Stankevitz wrote:
> 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.  

Sure.

1. cat > .gdbinit
   define myrun
     run <very long list of parameters that I hate typing>
   end
   ^D
2. gdb ./bin/debug/prog
3. myrun
4. [lots of debugger commands like c, n, s, break, etc]
5. myrun





More information about the Gdb mailing list