Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Side by Side Diff: util/win/process_info.cc

Issue 1430773003: win: Handle binary with embedded CodeView debug record (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « snapshot/win/pe_image_reader.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 is_64_bit_ = false; 507 is_64_bit_ = false;
508 } else { 508 } else {
509 // Otherwise, it's either 32 on 32, or 64 on 64. Use GetSystemInfo() to 509 // Otherwise, it's either 32 on 32, or 64 on 64. Use GetSystemInfo() to
510 // distinguish between these two cases. 510 // distinguish between these two cases.
511 SYSTEM_INFO system_info; 511 SYSTEM_INFO system_info;
512 GetSystemInfo(&system_info); 512 GetSystemInfo(&system_info);
513 is_64_bit_ = 513 is_64_bit_ =
514 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; 514 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
515 } 515 }
516 516
517 #if ARCH_CPU_32_BITS 517 #if defined(ARCH_CPU_32_BITS)
518 if (is_64_bit_) { 518 if (is_64_bit_) {
519 LOG(ERROR) << "Reading x64 process from x86 process not supported"; 519 LOG(ERROR) << "Reading x64 process from x86 process not supported";
520 return false; 520 return false;
521 } 521 }
522 #endif 522 #endif // ARCH_CPU_32_BITS
523 523
524 #if ARCH_CPU_64_BITS 524 #if defined(ARCH_CPU_64_BITS)
525 bool result = GetProcessBasicInformation<process_types::internal::Traits64>( 525 bool result = GetProcessBasicInformation<process_types::internal::Traits64>(
526 process, is_wow64_, this, &peb_address_, &peb_size_); 526 process, is_wow64_, this, &peb_address_, &peb_size_);
527 #else 527 #else
528 bool result = GetProcessBasicInformation<process_types::internal::Traits32>( 528 bool result = GetProcessBasicInformation<process_types::internal::Traits32>(
529 process, false, this, &peb_address_, &peb_size_); 529 process, false, this, &peb_address_, &peb_size_);
530 #endif // ARCH_CPU_64_BITS 530 #endif // ARCH_CPU_64_BITS
531 531
532 if (!result) { 532 if (!result) {
533 LOG(ERROR) << "GetProcessBasicInformation failed"; 533 LOG(ERROR) << "GetProcessBasicInformation failed";
534 return false; 534 return false;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 } else { 683 } else {
684 result.push_back(as_ranges[i]); 684 result.push_back(as_ranges[i]);
685 } 685 }
686 DCHECK(result.back().IsValid()); 686 DCHECK(result.back().IsValid());
687 } 687 }
688 688
689 return result; 689 return result;
690 } 690 }
691 691
692 } // namespace crashpad 692 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/win/pe_image_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698