| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #ifndef CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ | 15 #ifndef CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ |
| 16 #define CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ | 16 #define CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ |
| 17 | 17 |
| 18 #include <stdint.h> | 18 #include <stdint.h> |
| 19 #include <windows.h> | 19 #include <windows.h> |
| 20 | 20 |
| 21 #include "base/basictypes.h" | 21 #include "base/basictypes.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "snapshot/cpu_context.h" | 23 #include "snapshot/cpu_context.h" |
| 24 #include "snapshot/exception_snapshot.h" | 24 #include "snapshot/exception_snapshot.h" |
| 25 #include "util/misc/initialization_state_dcheck.h" | 25 #include "util/misc/initialization_state_dcheck.h" |
| 26 #include "util/win/address_types.h" | 26 #include "util/win/address_types.h" |
| 27 #include "util/win/process_structs.h" |
| 27 | 28 |
| 28 namespace crashpad { | 29 namespace crashpad { |
| 29 | 30 |
| 30 class ProcessReaderWin; | 31 class ProcessReaderWin; |
| 31 | 32 |
| 32 namespace internal { | 33 namespace internal { |
| 33 | 34 |
| 34 class ExceptionSnapshotWin final : public ExceptionSnapshot { | 35 class ExceptionSnapshotWin final : public ExceptionSnapshot { |
| 35 public: | 36 public: |
| 36 ExceptionSnapshotWin(); | 37 ExceptionSnapshotWin(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 // ExceptionSnapshot: | 55 // ExceptionSnapshot: |
| 55 | 56 |
| 56 const CPUContext* Context() const override; | 57 const CPUContext* Context() const override; |
| 57 uint64_t ThreadID() const override; | 58 uint64_t ThreadID() const override; |
| 58 uint32_t Exception() const override; | 59 uint32_t Exception() const override; |
| 59 uint32_t ExceptionInfo() const override; | 60 uint32_t ExceptionInfo() const override; |
| 60 uint64_t ExceptionAddress() const override; | 61 uint64_t ExceptionAddress() const override; |
| 61 const std::vector<uint64_t>& Codes() const override; | 62 const std::vector<uint64_t>& Codes() const override; |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 template <class ExceptionRecordType, class ContextType> | 65 template <class ExceptionRecordType, |
| 65 bool InitializeFromExceptionPointers( | 66 class ExceptionPointersType, |
| 66 const ProcessReaderWin& process_reader, | 67 class ContextType> |
| 67 const EXCEPTION_POINTERS& exception_pointers, | 68 bool InitializeFromExceptionPointers(const ProcessReaderWin& process_reader, |
| 68 ContextType* context_record); | 69 WinVMAddress exception_pointers_address, |
| 70 ContextType* context_record); |
| 69 | 71 |
| 70 #if defined(ARCH_CPU_X86_FAMILY) | 72 #if defined(ARCH_CPU_X86_FAMILY) |
| 71 union { | 73 union { |
| 72 CPUContextX86 x86; | 74 CPUContextX86 x86; |
| 73 CPUContextX86_64 x86_64; | 75 CPUContextX86_64 x86_64; |
| 74 } context_union_; | 76 } context_union_; |
| 75 #endif | 77 #endif |
| 76 CPUContext context_; | 78 CPUContext context_; |
| 77 std::vector<uint64_t> codes_; | 79 std::vector<uint64_t> codes_; |
| 78 uint64_t thread_id_; | 80 uint64_t thread_id_; |
| 79 uint64_t exception_address_; | 81 uint64_t exception_address_; |
| 80 uint32_t exception_flags_; | 82 uint32_t exception_flags_; |
| 81 DWORD exception_code_; | 83 DWORD exception_code_; |
| 82 InitializationStateDcheck initialized_; | 84 InitializationStateDcheck initialized_; |
| 83 | 85 |
| 84 DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotWin); | 86 DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotWin); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 } // namespace internal | 89 } // namespace internal |
| 88 } // namespace crashpad | 90 } // namespace crashpad |
| 89 | 91 |
| 90 #endif // CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ | 92 #endif // CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_ |
| OLD | NEW |