This is the mail archive of the
mailing list for the GDB project.
Re: proper usage of "-exec-interrupt"
On 9/17/11 11:06 PM, Joel Brobecker wrote:
I tried to move gdb into a distinct group with "setpgid(gdb_pid, 0)",
right after spawning it with "g_spawn_async_with_pipes".
Whay does this signal come to parent process and can I avoid this
This is a bit of a guess, since I don't remember all the details,
but I think it might be a question of process group. To implement
the interrupt, many targets simply send a SIGINT signal to the
inferior process group. If you spawned GDB within the same process
group as GDB, and both GDB and the program being debugged share
the same process group as well, the interrupt will cause SIGINT
to be received by your IDE as well. So, try spawning GDB in its
own process group.
If I do so SIGINT doesn't come to IDE but a program being debugged quits
right after executing "-exec-interrupt".
The gdb output is:
I also tried to do all this executing gdb from a terminal window and a
program had stopped correctly with stop reason="signal-received", no
Can't it be a bug, I've found several discussions with suggestions to
send SIGINT or SIGTSTP directly to a process being debugged instead of
using "-exec-interrupt" ?