Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Fix build on macOS
Date: Fri, 31 Jan 2020 14:43:00 -0000	[thread overview]
Message-ID: <20200131072300.5062774a@f31-4.lan> (raw)
In-Reply-To: <20191210214717.25680-1-tromey@adacore.com>

On Tue, 10 Dec 2019 14:47:17 -0700
Tom Tromey <tromey@adacore.com> wrote:

> PR build/25268 points out that the build fails on macOS, because on
> macOS the "pthread_setname_np" function takes a single argument.
> 
> This patch fixes the problem, by introducing a new template adapter
> function that handles both styles of pthread_setname_np.  This is a
> technique I learned from Alexandre Oliva, and avoids the need for a
> complicated autoconf check.
> 
> This change also meant moving the pthread_setname_np call to the
> thread function, because macOS only permits setting the name of the
> current thread.  This means that there can be a brief window when gdb
> will see the wrong name; but I think this is a minor concern.
> 
> Tested by rebuilding on x86-64 Fedora 30, and on macOS High Sierra.
> On Linux I also debugged gdb to ensure that the thread names are still
> set correctly.
> 
> gdb/ChangeLog
> 2019-12-10  Tom Tromey  <tromey@adacore.com>
> 
> 	PR build/25268:
> 	* gdbsupport/thread-pool.c (set_thread_name): New template
> 	function.
> 	(thread_pool::set_thread_count): Don't call pthread_setname_np.
> 	(thread_pool::thread_function): Call set_thread_name.

Did this ever go in?

If not, I think it looks reasonable.

Kevin


  parent reply	other threads:[~2020-01-31 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 21:47 Tom Tromey
2019-12-11  1:37 ` Simon Marchi
2019-12-11 13:52   ` Tom Tromey
2019-12-11 14:07     ` Simon Marchi
2020-01-31 14:43 ` Kevin Buettner [this message]
2020-01-31 16:52   ` Tom Tromey
2020-01-31 21:40     ` Kevin Buettner
2020-02-05 18:37       ` Christian Biesinger via gdb-patches

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=20200131072300.5062774a@f31-4.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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