This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: proper usage of "-exec-interrupt"


On 9/17/11 11:06 PM, Joel Brobecker wrote:
Whay does this signal come to parent process and can I avoid this
somehow?
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.

I tried to move gdb into a distinct group with "setpgid(gdb_pid, 0)", right after spawning it with "g_spawn_async_with_pipes".
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:


^done
(gdb)
&"Quit\n"
=thread-exited, .....
=thread-group-exited,....
*stopped,reason="exited-normally"

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 quits...

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" ?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]