Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 4/6] Use LWP IDs with ptrace register requests on FreeBSD.
Date: Sat, 16 Jan 2016 19:17:00 -0000	[thread overview]
Message-ID: <2651627.borPenzgRP@ralph.baldwin.cx> (raw)
In-Reply-To: <569A5626.8020507@redhat.com>

On Saturday, January 16, 2016 02:39:34 PM Pedro Alves wrote:
> On 01/15/2016 11:22 PM, John Baldwin wrote:
> 
> > Ok.  I made a pass and fixed the ones that I thought were relevant (i.e.
> > generating a pid to pass to ptrace()).   However, the vast majority of the
> > files changed were various foo-linux-nat.c files which I am not setup to
> > test.  
> 
> Hmm, actually, sorry about that, but I remembered that the ptid_get_lwp()==0
> paths in Linux code are dead code (90ad5e1d4f).  I see now that d89fa914ad6f
> cleaned most of the linux code, but left out the cases that were open coded.
> 
> So I think it's best to just leave those be.  Someone can always clean
> those up to use ptid_get_lwp directly afterwards.
> 
> I now think that to move forward with your patch, it's simpler/better to
> export get_ptrace_pid, and just use it in the cases you cared about,
> and leave other targets as is.

Ok.

> If you're changing the FreeBSD to always store an lwp, do you still
> need get_ptrace_pid, or would something like this instead work?
> 
> -      if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid),
> +      if (ptrace (PT_GETREGS, get_ptrace_lwp (inferior_ptid),
> 
> etc.  Or would you still need it because the foo-nat.c files you're
> touching are used by other BSDs as well?

Most of them are pan-BSD so they would need the helper, but ppcfbsd-nat.c
is FreeBSD-only, so it can use ptid_get_lwp() directly.

-- 
John Baldwin


      reply	other threads:[~2016-01-16 19:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 21:46 [PATCH v2 0/6] Support kernel-backed user threads " John Baldwin
2016-01-13 21:46 ` [PATCH v2 3/6] Display per-thread information for threads in FreeBSD cores John Baldwin
2016-01-14 15:03   ` Pedro Alves
2016-01-15 20:23     ` John Baldwin
2016-01-18 12:27       ` Pedro Alves
2016-01-18 17:06         ` John Baldwin
2016-01-18 17:13           ` Pedro Alves
2016-01-13 21:46 ` [PATCH v2 1/6] Add support to readelf for reading FreeBSD ELF core notes John Baldwin
2016-01-14  5:30   ` Alan Modra
2016-01-14  5:40     ` John Baldwin
2016-01-13 21:46 ` [PATCH v2 6/6] Dump register notes for each thread when generating a FreeBSD core John Baldwin
2016-01-14 15:34   ` Pedro Alves
2016-01-13 21:46 ` [PATCH v2 2/6] Add a psuedosection for the NT_FREEBSD_THRMISC note John Baldwin
2016-01-14  5:30   ` Alan Modra
2016-01-13 21:52 ` [PATCH v2 5/6] Add support for LWP-based threads on FreeBSD John Baldwin
2016-01-14 15:29   ` Pedro Alves
2016-01-15 23:54     ` John Baldwin
2016-01-16 14:47       ` Pedro Alves
2016-01-13 21:52 ` [PATCH v2 4/6] Use LWP IDs with ptrace register requests " John Baldwin
2016-01-14 15:07   ` Pedro Alves
2016-01-15 20:23     ` John Baldwin
2016-01-15 21:41       ` Pedro Alves
2016-01-15 23:54         ` John Baldwin
2016-01-16 14:39           ` Pedro Alves
2016-01-16 19:17             ` 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=2651627.borPenzgRP@ralph.baldwin.cx \
    --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