X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdbsupport%2Fptid.h;h=d66cd9884590c3d91c2aae3b3f3c3615a1de9ca2;hb=90a00d6c65e7cd015ab133a129819bddf685c2b3;hp=a0a91758b374e9ef3c1e3f5aaa166cfb652da6e5;hpb=3666a04883754298b03884222206bfe756fbc520;p=binutils-gdb.git diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h index a0a91758b37..d66cd988459 100644 --- a/gdbsupport/ptid.h +++ b/gdbsupport/ptid.h @@ -1,6 +1,6 @@ /* The ptid_t type and common functions operating on it. - Copyright (C) 1986-2021 Free Software Foundation, Inc. + Copyright (C) 1986-2022 Free Software Foundation, Inc. This file is part of GDB. @@ -33,6 +33,8 @@ */ #include +#include +#include "gdbsupport/common-types.h" class ptid_t { @@ -46,7 +48,7 @@ public: A ptid with only a PID (LWP and TID equal to zero) is usually used to represent a whole process, including all its lwps/threads. */ - explicit constexpr ptid_t (int pid, long lwp = 0, long tid = 0) + explicit constexpr ptid_t (int pid, long lwp = 0, ULONGEST tid = 0) : m_pid (pid), m_lwp (lwp), m_tid (tid) {} @@ -72,7 +74,7 @@ public: /* Fetch the tid (thread id) component from a ptid. */ - constexpr long tid () const + constexpr ULONGEST tid () const { return m_tid; } /* Return true if the ptid represents a whole process, including all its @@ -124,6 +126,12 @@ public: || *this == filter); } + /* Return a string representation of the ptid. + + This is only meant to be used in debug messages. */ + + std::string to_string () const; + /* Make a null ptid. */ static constexpr ptid_t make_null () @@ -142,7 +150,7 @@ private: long m_lwp; /* Thread id. */ - long m_tid; + ULONGEST m_tid; }; /* Functor to hash a ptid. */