From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v2 3/7] gdb, ptid: add is_lwp() and is_lwp_or_pid()
Date: Mon, 24 Jan 2022 16:32:56 +0000 [thread overview]
Message-ID: <DM8PR11MB57499FCEEB66886A4311A888DE5E9@DM8PR11MB5749.namprd11.prod.outlook.com> (raw)
In-Reply-To: <73c0f0ab-5b4f-761d-00fa-d589cd83c5f1@polymtl.ca>
Hello Simon,
Thanks for your review.
>> + /* Return true if the ptid represents a light-weight process. */
>> +
>> + constexpr bool is_lwp () const
>> + {
>> + return (*this != make_null ()
>> + && *this != make_minus_one ()
>> + && !is_pid ());
>
>What about the tid field? Just reading the name `is_lwp`, my intuition
>would be that it checks for a null tid field. So calling is_lwp on (1,
>2, 3) or (1, 0, 3) would return false.
>
>At this point it might be easier to write it as:
>
> return m_pid > 0 && m_lwp > 0 && m_tid == 0;
My interpretation was that the tid comes from some user-space
threading library that may or may not use light-weight processes
as their threads.
The tid field would hence not be relevant. Is that interpretation wrong?
Thanks,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2022-01-24 16:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 7:15 [PATCH v2 0/7] gdb, thread-iter: handle null_ptid Markus Metzger
2021-12-02 7:15 ` [PATCH v2 1/7] " Markus Metzger
2022-01-23 2:21 ` Simon Marchi
2021-12-02 7:15 ` [PATCH v2 2/7] gdb, btrace: rename record_btrace_enable_warn() Markus Metzger
2022-01-23 2:22 ` Simon Marchi
2021-12-02 7:15 ` [PATCH v2 3/7] gdb, ptid: add is_lwp() and is_lwp_or_pid() Markus Metzger
2022-01-23 2:36 ` Simon Marchi
2022-01-24 16:32 ` Metzger, Markus T [this message]
2022-01-24 17:04 ` Simon Marchi
2022-01-25 9:40 ` Metzger, Markus T
2021-12-02 7:15 ` [PATCH v2 4/7] gdb, btrace: check inferior_ptid in record_btrace_target::xfer_partial() Markus Metzger
2022-01-23 3:22 ` Simon Marchi
2022-01-24 16:58 ` Metzger, Markus T
2022-01-24 17:22 ` Simon Marchi
2022-01-25 9:40 ` Metzger, Markus T
2021-12-02 7:15 ` [PATCH v2 5/7] gdb, btrace: switch threads in remote_btrace_maybe_reopen() Markus Metzger
2022-01-23 3:24 ` Simon Marchi
2021-12-02 7:15 ` [PATCH v2 6/7] gdb, gdbserver: update thread identifier in enable_btrace target method Markus Metzger
2022-01-23 4:02 ` Simon Marchi
2022-01-24 16:40 ` Metzger, Markus T
2021-12-02 7:15 ` [PATCH v2 7/7] gdb, remote, btrace: move switch_to_thread call right before xfer call Markus Metzger
2022-01-23 4:19 ` Simon Marchi
2022-01-24 17:07 ` Metzger, Markus T
2022-01-21 11:41 ` [PATCH v2 0/7] gdb, thread-iter: handle null_ptid Metzger, Markus T
2022-01-27 12:49 ` Metzger, Markus T
2022-01-27 17:04 ` Simon Marchi
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=DM8PR11MB57499FCEEB66886A4311A888DE5E9@DM8PR11MB5749.namprd11.prod.outlook.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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).