GDB: Run program automatically
I'm running gdb to debug a program, and want to make it so that I don't have to enter "run" every time I want to start the application. Anybody got any ideas on how is this done?
|
If you don't type run, how can you pass the parameter to the being-debugged program?
|
I gotta ask: what's wrong with typing "r-u-n"?
PS: Understanding why you're asking might help us give you a better solution. For example, maybe you're actually looking for an automated script that can attach to and get a stack traceback from a live process (something that's both do-able, and actually fairly easy, btw). |
Just to clearify: I'm developing a distributed application, and having to type "run" in four terminals every time I start the application is very time consuming. Every time I start the application four xterms pop up, each running a ssh-session to a remote machine. This is why I want to avoid typing "run".
If there is some other way of doing this feel free to give me a hint. |
In order to run the application automatically under gdb I need to type "r" i the terminal. Isn't there some way of passing an argument to gdb similar to typing "r" in the terminal? Something like
gdb <application> < echo 'r' or something? |
how to do it
gdb -ex run your-program
gdb -ex run --args your-program arg1 arg2 ... |
All times are GMT -5. The time now is 10:30 PM. |