OLD | NEW |
1 // Copyright (c) 2014 Google Inc. | 1 // Copyright (c) 2014 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 DumpContext::SetContextARM64(arm64); | 126 DumpContext::SetContextARM64(arm64); |
127 valid_ = true; | 127 valid_ = true; |
128 } | 128 } |
129 | 129 |
130 void MicrodumpContext::SetContextX86(MDRawContextX86* x86) { | 130 void MicrodumpContext::SetContextX86(MDRawContextX86* x86) { |
131 DumpContext::SetContextFlags(MD_CONTEXT_X86); | 131 DumpContext::SetContextFlags(MD_CONTEXT_X86); |
132 DumpContext::SetContextX86(x86); | 132 DumpContext::SetContextX86(x86); |
133 valid_ = true; | 133 valid_ = true; |
134 } | 134 } |
135 | 135 |
136 void MicrodumpContext::SetContextMIPS(MDRawContextMIPS* mips) { | 136 void MicrodumpContext::SetContextMIPS(MDRawContextMIPS* mips32) { |
137 DumpContext::SetContextFlags(MD_CONTEXT_MIPS); | 137 DumpContext::SetContextFlags(MD_CONTEXT_MIPS); |
138 DumpContext::SetContextMIPS(mips); | 138 DumpContext::SetContextMIPS(mips32); |
139 valid_ = true; | 139 valid_ = true; |
140 } | 140 } |
141 | 141 |
142 void MicrodumpContext::SetContextMIPS64(MDRawContextMIPS* mips64) { | 142 void MicrodumpContext::SetContextMIPS64(MDRawContextMIPS* mips64) { |
143 DumpContext::SetContextFlags(MD_CONTEXT_MIPS64); | 143 DumpContext::SetContextFlags(MD_CONTEXT_MIPS64); |
144 DumpContext::SetContextMIPS(mips64); | 144 DumpContext::SetContextMIPS(mips64); |
145 valid_ = true; | 145 valid_ = true; |
146 } | 146 } |
147 | 147 |
148 | 148 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 MDRawContextX86* x86 = new MDRawContextX86(); | 323 MDRawContextX86* x86 = new MDRawContextX86(); |
324 memcpy(x86, &cpu_state_raw[0], cpu_state_raw.size()); | 324 memcpy(x86, &cpu_state_raw[0], cpu_state_raw.size()); |
325 context_->SetContextX86(x86); | 325 context_->SetContextX86(x86); |
326 } else if (strcmp(arch.c_str(), kMipsArchitecture) == 0) { | 326 } else if (strcmp(arch.c_str(), kMipsArchitecture) == 0) { |
327 if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) { | 327 if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) { |
328 std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() | 328 std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() |
329 << " bytes instead of " << sizeof(MDRawContextMIPS) | 329 << " bytes instead of " << sizeof(MDRawContextMIPS) |
330 << std::endl; | 330 << std::endl; |
331 continue; | 331 continue; |
332 } | 332 } |
333 MDRawContextMIPS* mips = new MDRawContextMIPS(); | 333 MDRawContextMIPS* mips32 = new MDRawContextMIPS(); |
334 memcpy(mips, &cpu_state_raw[0], cpu_state_raw.size()); | 334 memcpy(mips32, &cpu_state_raw[0], cpu_state_raw.size()); |
335 context_->SetContextMIPS(mips); | 335 context_->SetContextMIPS(mips32); |
336 } else if (strcmp(arch.c_str(), kMips64Architecture) == 0) { | 336 } else if (strcmp(arch.c_str(), kMips64Architecture) == 0) { |
337 if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) { | 337 if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) { |
338 std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() | 338 std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() |
339 << " bytes instead of " << sizeof(MDRawContextMIPS) | 339 << " bytes instead of " << sizeof(MDRawContextMIPS) |
340 << std::endl; | 340 << std::endl; |
341 continue; | 341 continue; |
342 } | 342 } |
343 MDRawContextMIPS* mips64 = new MDRawContextMIPS(); | 343 MDRawContextMIPS* mips64 = new MDRawContextMIPS(); |
344 memcpy(mips64, &cpu_state_raw[0], cpu_state_raw.size()); | 344 memcpy(mips64, &cpu_state_raw[0], cpu_state_raw.size()); |
345 context_->SetContextMIPS64(mips64); | 345 context_->SetContextMIPS64(mips64); |
(...skipping 26 matching lines...) Expand all Loading... |
372 filename, // debug_file | 372 filename, // debug_file |
373 identifier, // debug_identifier | 373 identifier, // debug_identifier |
374 "")); // version | 374 "")); // version |
375 } | 375 } |
376 } | 376 } |
377 stack_region_->Init(stack_start, stack_content); | 377 stack_region_->Init(stack_start, stack_content); |
378 } | 378 } |
379 | 379 |
380 } // namespace google_breakpad | 380 } // namespace google_breakpad |
381 | 381 |
OLD | NEW |