OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_THREAD_ID_MAP_H_ |
| 16 #define CRASHPAD_MINIDUMP_MINIDUMP_THREAD_ID_MAP_H_ |
| 17 |
| 18 #include <stdint.h> |
| 19 |
| 20 #include <map> |
| 21 #include <vector> |
| 22 |
| 23 namespace crashpad { |
| 24 |
| 25 class ThreadSnapshot; |
| 26 |
| 27 //! \brief A map that connects 64-bit snapshot thread IDs to 32-bit minidump |
| 28 //! thread IDs. |
| 29 //! |
| 30 //! 64-bit snapshot thread IDs are obtained from ThreadSnapshot::ThreadID(). |
| 31 //! 32-bit minidump thread IDs are stored in MINIDUMP_THREAD::ThreadId. |
| 32 //! |
| 33 //! A ThreadIDMap ensures that there are no collisions among the set of 32-bit |
| 34 //! minidump thread IDs. |
| 35 using MinidumpThreadIDMap = std::map<uint64_t, uint32_t>; |
| 36 |
| 37 //! \brief Builds a MinidumpThreadIDMap for a group of ThreadSnapshot objects. |
| 38 //! |
| 39 //! \param[in] thread_snapshots The thread snapshots to use as source data. |
| 40 //! \param[out] thread_id_map A MinidumpThreadIDMap to be built by this method. |
| 41 //! This map must be empty when this function is called. |
| 42 //! |
| 43 //! The map ensures that for any unique 64-bit thread ID found in a |
| 44 //! ThreadSnapshot, the 32-bit thread ID used in a minidump file will also be |
| 45 //! unique. |
| 46 void BuildMinidumpThreadIDMap( |
| 47 const std::vector<const ThreadSnapshot*>& thread_snapshots, |
| 48 MinidumpThreadIDMap* thread_id_map); |
| 49 |
| 50 } // namespace crashpad |
| 51 |
| 52 #endif // CRASHPAD_MINIDUMP_MINIDUMP_THREAD_ID_MAP_H_ |
OLD | NEW |