From: John Baldwin <jhb@FreeBSD.org>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 0/2] Fix x86 debug registers on FreeBSD with threads
Date: Fri, 01 Jul 2016 14:58:00 -0000 [thread overview]
Message-ID: <0397773c-07ea-acfa-b14d-5252ce09fef6@FreeBSD.org> (raw)
In-Reply-To: <5d3788cc-400b-3efa-4a88-dc3a072ce706@redhat.com>
On 7/1/16 9:02 AM, Pedro Alves wrote:
> On 06/28/2016 11:55 PM, John Baldwin wrote:
>> The pan-BSD x86 debug register support code was only setting the
>> debug registers on the current LWP identified by inferior_ptid.
>> This fixes the code to set the debug registers on all of the LWPs
>> belonging to the current inferior on each change.
>
> Looks good to me.
>
> Spotted a missing space in:
>
> ALL_NON_EXITED_THREADS(thread)
Fixed in pushed version, thanks.
>> One question I have is that the amd64 x86 debug register code was
>> invoking x86_cleanup_dregs in the mourn_inferior target op, but
>> the x86 linux native code calls this in the post_startup_inferior
>> target op instead. Any ideas as to why they are different?
>
> Not sure. Probably history, or maybe to be sure to paper over
> potential problems from the "inferior exit/dies/detached" end missing
> clearing the reg state. OTOH, I think target_post_startup_inferior
> isn't called for attach.
> Note that mourn_inferior isn't called in some cases. Some targets call
> it from within their to_detach and to_kill target methods, but that's
> not guaranteed. I think that linux-nat.c doesn't call it from its
> to_detach, but OTOH, when you get there, watchpoints had better have
> been removed from the target already. But maybe there's a problem
> as follow-fork time, not sure. Note that the linux native code
> also calls x86_forget_process directly through linux_nat_forget_process.
Hmm, it seems that for FreeBSD at least mourn_inferior is only called
from inf_ptrace_kill() and not from detach either. I'll have to think
about this more. On the surface it would seem that mourn_inferior
could at least use x86_forget_process to only discard state for the
process going away rather than discarding the entire list.
--
John Baldwin
prev parent reply other threads:[~2016-07-01 14:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 22:57 John Baldwin
2016-06-28 22:57 ` [PATCH 2/2] Set debug registers on all threads belonging to the current inferior John Baldwin
2016-06-28 22:57 ` [PATCH 1/2] Consolidate x86 debug register code for BSD native targets John Baldwin
2016-07-01 13:02 ` [PATCH 0/2] Fix x86 debug registers on FreeBSD with threads Pedro Alves
2016-07-01 14:58 ` John Baldwin [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=0397773c-07ea-acfa-b14d-5252ce09fef6@FreeBSD.org \
--to=jhb@freebsd.org \
--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