diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:36:23 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:46:02 -0500 |
commit | c583a2520616c2736cffc389c89a48b159366e6c (patch) | |
tree | b4925f26506fcee96c16119431c01760f05db95d /gdbsupport/ptid.h | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | gdb-users/simark/clang-format.zip gdb-users/simark/clang-format.tar.gz gdb-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdbsupport/ptid.h')
-rw-r--r-- | gdbsupport/ptid.h | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h index aa296b8..deb2ea8 100644 --- a/gdbsupport/ptid.h +++ b/gdbsupport/ptid.h @@ -53,33 +53,31 @@ public: represent a whole process, including all its lwps/threads. */ explicit constexpr ptid_t (pid_type pid, lwp_type lwp = 0, tid_type tid = 0) - : m_pid (pid), m_lwp (lwp), m_tid (tid) - {} + : m_pid (pid), + m_lwp (lwp), + m_tid (tid) + { + } /* Fetch the pid (process id) component from the ptid. */ - constexpr pid_type pid () const - { return m_pid; } + constexpr pid_type pid () const { return m_pid; } /* Return true if the ptid's lwp member is non-zero. */ - constexpr bool lwp_p () const - { return m_lwp != 0; } + constexpr bool lwp_p () const { return m_lwp != 0; } /* Fetch the lwp (lightweight process) component from the ptid. */ - constexpr lwp_type lwp () const - { return m_lwp; } + constexpr lwp_type lwp () const { return m_lwp; } /* Return true if the ptid's tid member is non-zero. */ - constexpr bool tid_p () const - { return m_tid != 0; } + constexpr bool tid_p () const { return m_tid != 0; } /* Fetch the tid (thread id) component from a ptid. */ - constexpr tid_type tid () const - { return m_tid; } + constexpr tid_type tid () const { return m_tid; } /* Return true if the ptid represents a whole process, including all its lwps/threads. Such ptids have the form of (pid, 0, 0), with @@ -87,19 +85,16 @@ public: constexpr bool is_pid () const { - return (*this != make_null () - && *this != make_minus_one () - && m_lwp == 0 - && m_tid == 0); + return (*this != make_null () && *this != make_minus_one () && m_lwp == 0 + && m_tid == 0); } /* Compare two ptids to see if they are equal. */ constexpr bool operator== (const ptid_t &other) const { - return (m_pid == other.m_pid - && m_lwp == other.m_lwp - && m_tid == other.m_tid); + return (m_pid == other.m_pid && m_lwp == other.m_lwp + && m_tid == other.m_tid); } /* Compare two ptids to see if they are different. */ @@ -120,14 +115,14 @@ public: constexpr bool matches (const ptid_t &filter) const { return (/* If filter represents any ptid, it's always a match. */ - filter == make_minus_one () - /* If filter is only a pid, any ptid with that pid + filter == make_minus_one () + /* If filter is only a pid, any ptid with that pid matches. */ - || (filter.is_pid () && m_pid == filter.pid ()) + || (filter.is_pid () && m_pid == filter.pid ()) - /* Otherwise, this ptid only matches if it's exactly equal + /* Otherwise, this ptid only matches if it's exactly equal to filter. */ - || *this == filter); + || *this == filter); } /* Return a string representation of the ptid. @@ -138,13 +133,11 @@ public: /* Make a null ptid. */ - static constexpr ptid_t make_null () - { return ptid_t (0, 0, 0); } + static constexpr ptid_t make_null () { return ptid_t (0, 0, 0); } /* Make a minus one ptid. */ - static constexpr ptid_t make_minus_one () - { return ptid_t (-1, 0, 0); } + static constexpr ptid_t make_minus_one () { return ptid_t (-1, 0, 0); } private: /* Process id. */ @@ -165,9 +158,8 @@ struct hash_ptid { std::hash<long> long_hash; - return (long_hash (ptid.pid ()) - + long_hash (ptid.lwp ()) - + long_hash (ptid.tid ())); + return (long_hash (ptid.pid ()) + long_hash (ptid.lwp ()) + + long_hash (ptid.tid ())); } }; |