diff options
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/ptid.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h index ef52d55..a528312 100644 --- a/gdbsupport/ptid.h +++ b/gdbsupport/ptid.h @@ -32,6 +32,8 @@ thread_stratum target that might want to sit on top. */ +#include <functional> + class ptid_t { public: @@ -143,6 +145,20 @@ private: long m_tid; }; +/* Functor to hash a ptid. */ + +struct hash_ptid +{ + size_t operator() (const ptid_t &ptid) const + { + std::hash<long> long_hash; + + return (long_hash (ptid.pid ()) + + long_hash (ptid.lwp ()) + + long_hash (ptid.tid ())); + } +}; + /* The null or zero ptid, often used to indicate no process. */ extern const ptid_t null_ptid; |