From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Do not respawn signals, take 2.
Date: Fri, 22 Jun 2012 19:18:00 -0000 [thread overview]
Message-ID: <20120622191823.GA10515@host2.jankratochvil.net> (raw)
In-Reply-To: <20120622145525.27114.25720.stgit@brno.lan>
On Fri, 22 Jun 2012 16:55:25 +0200, Pedro Alves wrote:
> @@ -1950,9 +1954,24 @@ resume_lwp (struct lwp_info *lp, int step)
> }
>
> static int
> -resume_callback (struct lwp_info *lp, void *data)
> +linux_nat_resume_callback (struct lwp_info *lp, void *data)
> {
> - resume_lwp (lp, 0);
> + enum gdb_signal signo = GDB_SIGNAL_0;
> +
> + if (lp->stopped)
> + {
> + struct thread_info *thread;
> +
> + thread = find_thread_ptid (lp->ptid);
> + if (thread != NULL)
> + {
> + if (signal_pass_state (thread->suspend.stop_signal))
This signal_pass_state check seems redundant to me. At least
remote.c append_pending_thread_resumptions does not do the check and infrun.c
already seems to pre-clear it:
/* If this signal should not be seen by program,
give it zero. Used for debugging signals. */
else if (!signal_program[tp->suspend.stop_signal])
tp->suspend.stop_signal = GDB_SIGNAL_0;
> + signo = thread->suspend.stop_signal;
> + thread->suspend.stop_signal = GDB_SIGNAL_0;
> + }
> + }
> +
> + resume_lwp (lp, 0, signo);
> return 0;
> }
>
[...]
> @@ -2856,6 +2875,8 @@ stop_wait_callback (struct lwp_info *lp, void *data)
> {
> int status;
>
> + gdb_assert (lp->resumed);
> +
> status = wait_lwp (lp);
> if (status == 0)
> return 0;
This assertion happens sometimes.
https://bugzilla.redhat.com/show_bug.cgi?id=808404
The assertion seems right to me, IIRC you also concluded it indicates a Linux
kernel bug where sometimes SIGSTOP is not generated by PTRACE_ATTACH.
Keeping the assertion may give more clue in bugreports when the Linux kernel
bug happens but AFAIK the FSF GDB policy is against such "more assertion for
better bugreports" policy. But it is also true I do not know what GDB will do
if the kernel bug happens and this assertion is not in place.
Therefore for FSF GDB the general approach is it should be removed.
Thanks,
Jan
next prev parent reply other threads:[~2012-06-22 19:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 14:55 Pedro Alves
2012-06-22 15:05 ` Jan Kratochvil
2012-06-22 15:12 ` Pedro Alves
2012-06-22 16:07 ` Jan Kratochvil
2012-06-28 17:51 ` x86 incomplete/WIP software single-step implementation (Re: [PATCH] Do not respawn signals, take 2.) Pedro Alves
2012-07-04 15:35 ` Pedro Alves
2012-07-04 19:45 ` Mark Kettenis
2012-06-22 19:18 ` Jan Kratochvil [this message]
2012-06-28 17:28 ` [PATCH] Do not respawn signals, take 2 Pedro Alves
2012-06-28 17:32 ` Jan Kratochvil
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=20120622191823.GA10515@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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