| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const CPUContextX86_64* context_snapshot) { | 153 const CPUContextX86_64* context_snapshot) { |
| 154 DCHECK_EQ(state(), kStateMutable); | 154 DCHECK_EQ(state(), kStateMutable); |
| 155 DCHECK_EQ(context_.context_flags, kMinidumpContextAMD64); | 155 DCHECK_EQ(context_.context_flags, kMinidumpContextAMD64); |
| 156 | 156 |
| 157 context_.context_flags = kMinidumpContextAMD64All; | 157 context_.context_flags = kMinidumpContextAMD64All; |
| 158 | 158 |
| 159 context_.mx_csr = context_snapshot->fxsave.mxcsr; | 159 context_.mx_csr = context_snapshot->fxsave.mxcsr; |
| 160 context_.cs = context_snapshot->cs; | 160 context_.cs = context_snapshot->cs; |
| 161 context_.fs = context_snapshot->fs; | 161 context_.fs = context_snapshot->fs; |
| 162 context_.gs = context_snapshot->gs; | 162 context_.gs = context_snapshot->gs; |
| 163 context_.eflags = context_snapshot->rflags; | 163 // The top 32 bits of rflags are reserved/unused. |
| 164 context_.eflags = static_cast<uint32_t>(context_snapshot->rflags); |
| 164 context_.dr0 = context_snapshot->dr0; | 165 context_.dr0 = context_snapshot->dr0; |
| 165 context_.dr1 = context_snapshot->dr1; | 166 context_.dr1 = context_snapshot->dr1; |
| 166 context_.dr2 = context_snapshot->dr2; | 167 context_.dr2 = context_snapshot->dr2; |
| 167 context_.dr3 = context_snapshot->dr3; | 168 context_.dr3 = context_snapshot->dr3; |
| 168 context_.dr6 = context_snapshot->dr6; | 169 context_.dr6 = context_snapshot->dr6; |
| 169 context_.dr7 = context_snapshot->dr7; | 170 context_.dr7 = context_snapshot->dr7; |
| 170 context_.rax = context_snapshot->rax; | 171 context_.rax = context_snapshot->rax; |
| 171 context_.rcx = context_snapshot->rcx; | 172 context_.rcx = context_snapshot->rcx; |
| 172 context_.rdx = context_snapshot->rdx; | 173 context_.rdx = context_snapshot->rdx; |
| 173 context_.rbx = context_snapshot->rbx; | 174 context_.rbx = context_snapshot->rbx; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 202 return file_writer->Write(&context_, sizeof(context_)); | 203 return file_writer->Write(&context_, sizeof(context_)); |
| 203 } | 204 } |
| 204 | 205 |
| 205 size_t MinidumpContextAMD64Writer::ContextSize() const { | 206 size_t MinidumpContextAMD64Writer::ContextSize() const { |
| 206 DCHECK_GE(state(), kStateFrozen); | 207 DCHECK_GE(state(), kStateFrozen); |
| 207 | 208 |
| 208 return sizeof(context_); | 209 return sizeof(context_); |
| 209 } | 210 } |
| 210 | 211 |
| 211 } // namespace crashpad | 212 } // namespace crashpad |
| OLD | NEW |