Results 1 to 2 of 2
I want to spawn a GDB session from bash script and keep it working to interact it from outside. But when I start it in background (with '&' sigil)
Code:
...
- 11-22-2010 #1Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
Gdb terminates when spawned from shell
I want to spawn a GDB session from bash script and keep it working to interact it from outside. But when I start it in background (with '&' sigil)
It executes passed script and terminates by itself (I do not pass any data or signals to it)Code:gdb -x gdb_script.txt ./a.out < gdb_pipe.fifo &
What can I do to make it alive?Code:Breakpoint 33, main (argc=1, argv=0xbffff0f4) at main.c:53 ---Type <return> to continue, or q <return> to quit---53 read_main_config(); (gdb) quit A debugging session is active. Inferior 1 [process 5957] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal]
- 11-23-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
GDB has to run in the foreground, unless you redirect stdin, stdout, and stderr.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote