OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 switch (context_snapshot->architecture) { | 33 switch (context_snapshot->architecture) { |
34 case kCPUArchitectureX86: { | 34 case kCPUArchitectureX86: { |
35 MinidumpContextX86Writer* context_x86 = new MinidumpContextX86Writer(); | 35 MinidumpContextX86Writer* context_x86 = new MinidumpContextX86Writer(); |
36 context.reset(context_x86); | 36 context.reset(context_x86); |
37 context_x86->InitializeFromSnapshot(context_snapshot->x86); | 37 context_x86->InitializeFromSnapshot(context_snapshot->x86); |
38 break; | 38 break; |
39 } | 39 } |
40 | 40 |
41 case kCPUArchitectureX86_64: { | 41 case kCPUArchitectureX86_64: { |
| 42 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_X86) |
| 43 #pragma warning(push) |
| 44 #pragma warning(disable: 4316) // Object allocated on the heap may not be 16 |
| 45 // byte aligned. |
| 46 #endif |
42 MinidumpContextAMD64Writer* context_amd64 = | 47 MinidumpContextAMD64Writer* context_amd64 = |
43 new MinidumpContextAMD64Writer(); | 48 new MinidumpContextAMD64Writer(); |
| 49 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_X86) |
| 50 #pragma warning(pop) |
| 51 #endif |
44 context.reset(context_amd64); | 52 context.reset(context_amd64); |
45 context_amd64->InitializeFromSnapshot(context_snapshot->x86_64); | 53 context_amd64->InitializeFromSnapshot(context_snapshot->x86_64); |
46 break; | 54 break; |
47 } | 55 } |
48 | 56 |
49 default: { | 57 default: { |
50 LOG(ERROR) << "unknown context architecture " | 58 LOG(ERROR) << "unknown context architecture " |
51 << context_snapshot->architecture; | 59 << context_snapshot->architecture; |
52 break; | 60 break; |
53 } | 61 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 return file_writer->Write(&context_, sizeof(context_)); | 211 return file_writer->Write(&context_, sizeof(context_)); |
204 } | 212 } |
205 | 213 |
206 size_t MinidumpContextAMD64Writer::ContextSize() const { | 214 size_t MinidumpContextAMD64Writer::ContextSize() const { |
207 DCHECK_GE(state(), kStateFrozen); | 215 DCHECK_GE(state(), kStateFrozen); |
208 | 216 |
209 return sizeof(context_); | 217 return sizeof(context_); |
210 } | 218 } |
211 | 219 |
212 } // namespace crashpad | 220 } // namespace crashpad |
OLD | NEW |