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 | |
47 MinidumpContextAMD64Writer* context_amd64 = | 42 MinidumpContextAMD64Writer* context_amd64 = |
48 new MinidumpContextAMD64Writer(); | 43 MSVC_SUPPRESS_WARNING(4316) new MinidumpContextAMD64Writer(); |
scottmg
2015/02/05 18:03:14
This one is tricky. Putting it above line 42 is in
Mark Mentovai
2015/02/05 18:24:10
scottmg wrote:
scottmg
2015/02/05 18:51:42
Done.
| |
49 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_X86) | |
50 #pragma warning(pop) | |
51 #endif | |
52 context.reset(context_amd64); | 44 context.reset(context_amd64); |
53 context_amd64->InitializeFromSnapshot(context_snapshot->x86_64); | 45 context_amd64->InitializeFromSnapshot(context_snapshot->x86_64); |
54 break; | 46 break; |
55 } | 47 } |
56 | 48 |
57 default: { | 49 default: { |
58 LOG(ERROR) << "unknown context architecture " | 50 LOG(ERROR) << "unknown context architecture " |
59 << context_snapshot->architecture; | 51 << context_snapshot->architecture; |
60 break; | 52 break; |
61 } | 53 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 return file_writer->Write(&context_, sizeof(context_)); | 203 return file_writer->Write(&context_, sizeof(context_)); |
212 } | 204 } |
213 | 205 |
214 size_t MinidumpContextAMD64Writer::ContextSize() const { | 206 size_t MinidumpContextAMD64Writer::ContextSize() const { |
215 DCHECK_GE(state(), kStateFrozen); | 207 DCHECK_GE(state(), kStateFrozen); |
216 | 208 |
217 return sizeof(context_); | 209 return sizeof(context_); |
218 } | 210 } |
219 | 211 |
220 } // namespace crashpad | 212 } // namespace crashpad |
OLD | NEW |