| 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_SNAPSHOT_THREAD_SNAPSHOT_H_ |
| 16 #define CRASHPAD_SNAPSHOT_THREAD_SNAPSHOT_H_ |
| 17 |
| 18 #include <stdint.h> |
| 19 |
| 20 #include <vector> |
| 21 |
| 22 namespace crashpad { |
| 23 |
| 24 struct CPUContext; |
| 25 class MemorySnapshot; |
| 26 |
| 27 //! \brief An abstract interface to a snapshot representing a thread |
| 28 //! (lightweight process) present in a snapshot process. |
| 29 class ThreadSnapshot { |
| 30 public: |
| 31 virtual ~ThreadSnapshot() {} |
| 32 |
| 33 //! \brief Returns a CPUContext object corresponding to the thread’s CPU |
| 34 //! context. |
| 35 //! |
| 36 //! The caller does not take ownership of this object, it is scoped to the |
| 37 //! lifetime of the ThreadSnapshot object that it was obtained from. |
| 38 virtual const CPUContext* Context() const = 0; |
| 39 |
| 40 //! \brief Returns a MemorySnapshot object corresponding to the memory region |
| 41 //! that contains the thread’s stack, or `nullptr` if no stack region is |
| 42 //! available. |
| 43 //! |
| 44 //! The caller does not take ownership of this object, it is scoped to the |
| 45 //! lifetime of the ThreadSnapshot object that it was obtained from. |
| 46 virtual const MemorySnapshot* Stack() const = 0; |
| 47 |
| 48 //! \brief Returns the thread’s identifier. |
| 49 //! |
| 50 //! %Thread identifiers are at least unique within a process, and may be |
| 51 //! unique system-wide. |
| 52 virtual uint64_t ThreadID() const = 0; |
| 53 |
| 54 //! \brief Returns the thread’s suspend count. |
| 55 //! |
| 56 //! A suspend count of `0` denotes a schedulable (not suspended) thread. |
| 57 virtual int SuspendCount() const = 0; |
| 58 |
| 59 //! \brief Returns the thread’s priority. |
| 60 //! |
| 61 //! Threads with higher priorities will have higher priority values. |
| 62 virtual int Priority() const = 0; |
| 63 |
| 64 //! \brief Returns the base address of a region used to store thread-specific |
| 65 //! data. |
| 66 virtual uint64_t ThreadSpecificDataAddress() const = 0; |
| 67 |
| 68 //! \brief Returns a vector of additional memory blocks that should be |
| 69 //! included in a minidump. |
| 70 //! |
| 71 //! \return A vector of MemorySnapshot objects that will be included in the |
| 72 //! crash dump. The caller does not take ownership of these objects, they |
| 73 //! are scoped to the lifetime of the ThreadSnapshot object that they |
| 74 //! were obtained from. |
| 75 virtual std::vector<const MemorySnapshot*> ExtraMemory() const = 0; |
| 76 }; |
| 77 |
| 78 } // namespace crashpad |
| 79 |
| 80 #endif // CRASHPAD_SNAPSHOT_THREAD_SNAPSHOT_H_ |
| OLD | NEW |