From: Alexander Petukhov <devel@apetukhov.ru>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb@sourceware.org
Subject: Re: proper usage of "-exec-interrupt"
Date: Mon, 19 Sep 2011 14:13:00 -0000 [thread overview]
Message-ID: <4E774DE7.20606@apetukhov.ru> (raw)
In-Reply-To: <20110917190624.GQ12670@adacore.com>
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" ?
prev parent reply other threads:[~2011-09-19 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-17 7:17 Alexander Petukhov
2011-09-17 19:06 ` Joel Brobecker
2011-09-19 14:13 ` Alexander Petukhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E774DE7.20606@apetukhov.ru \
--to=devel@apetukhov.ru \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).