Saturday, October 30, 2010

How to script gdb? Example add breakpoints, run, what breakpoint did we hit?

Programmer Question

Hi



How can I script gdb to do some basic stuff for me?



I would like to write some kind of script for gdb that more or less does this:




  1. Add a couple of breakpoints

  2. Start the program

  3. When we stop, where did it stop (get the frame info)

  4. Quit.



Today I'm trying to do this with



gdb --batch --command=commands.gdb


But it is not working...



Any ideas?



Thanks
Johan



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails