I want to debug a program, using gdb. But I invoke that program through a script.
How can I use gdb? The script is long and its not possible for me to invoke the program directly using command line arguments from gdb.
Also the process that is created when the script starts is short lived so can't attach gdb to the process.
What I want to do is something like, start gdb with that program, add my breakpoints then execute the script (FYI - it also takes arguments), then when it hits breakpoint do whatever I want.
I looked at shell option in gdb, but that spawns a new shell if I am not wrong and return to gdb when done. This is not what I want.
Please let me know if there is a better way.