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, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 context_.x86_64 = &context_union_.x86_64; | 43 context_.x86_64 = &context_union_.x86_64; |
44 InitializeX64Context(process_reader_thread.context, context_.x86_64); | 44 InitializeX64Context(process_reader_thread.context, context_.x86_64); |
45 } else { | 45 } else { |
46 context_.architecture = kCPUArchitectureX86; | 46 context_.architecture = kCPUArchitectureX86; |
47 context_.x86 = &context_union_.x86; | 47 context_.x86 = &context_union_.x86; |
48 InitializeX86Context( | 48 InitializeX86Context( |
49 *reinterpret_cast<const WOW64_CONTEXT*>(&process_reader_thread.context), | 49 *reinterpret_cast<const WOW64_CONTEXT*>(&process_reader_thread.context), |
50 context_.x86); | 50 context_.x86); |
51 } | 51 } |
52 #else | 52 #else |
53 #error ARCH_CPU_X86 | 53 context_.architecture = kCPUArchitectureX86; |
| 54 context_.x86 = &context_union_.x86; |
| 55 InitializeX86Context( |
| 56 *reinterpret_cast<const CONTEXT*>(&process_reader_thread.context), |
| 57 context_.x86); |
54 #endif // ARCH_CPU_X86_64 | 58 #endif // ARCH_CPU_X86_64 |
55 | 59 |
56 INITIALIZATION_STATE_SET_VALID(initialized_); | 60 INITIALIZATION_STATE_SET_VALID(initialized_); |
57 return true; | 61 return true; |
58 } | 62 } |
59 | 63 |
60 const CPUContext* ThreadSnapshotWin::Context() const { | 64 const CPUContext* ThreadSnapshotWin::Context() const { |
61 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 65 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
62 return &context_; | 66 return &context_; |
63 } | 67 } |
(...skipping 18 matching lines...) Expand all Loading... |
82 return thread_.priority; | 86 return thread_.priority; |
83 } | 87 } |
84 | 88 |
85 uint64_t ThreadSnapshotWin::ThreadSpecificDataAddress() const { | 89 uint64_t ThreadSnapshotWin::ThreadSpecificDataAddress() const { |
86 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 90 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
87 return thread_.teb; | 91 return thread_.teb; |
88 } | 92 } |
89 | 93 |
90 } // namespace internal | 94 } // namespace internal |
91 } // namespace crashpad | 95 } // namespace crashpad |
OLD | NEW |