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

Side by Side Diff: src/common/mac/macho_reader.cc

Issue 1369233003: [mac] Teach dump_syms to handle additional zerofill sections (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad@master
Patch Set: Address review comments Created 5 years, 2 months 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 | « no previous file | 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 (c) 2010, Google Inc. 1 // Copyright (c) 2010, 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 >> dummy32 474 >> dummy32
475 >> section.flags 475 >> section.flags
476 >> dummy32 476 >> dummy32
477 >> dummy32; 477 >> dummy32;
478 if (section.bits_64) 478 if (section.bits_64)
479 cursor >> dummy32; 479 cursor >> dummy32;
480 if (!cursor) { 480 if (!cursor) {
481 reporter_->SectionsMissing(segment.name); 481 reporter_->SectionsMissing(segment.name);
482 return false; 482 return false;
483 } 483 }
484 if ((section.flags & SECTION_TYPE) == S_ZEROFILL) { 484 const uint32_t section_type = section.flags & SECTION_TYPE;
485 if (section_type == S_ZEROFILL || section_type == S_THREAD_LOCAL_ZEROFILL ||
486 section_type == S_GB_ZEROFILL) {
485 // Zero-fill sections have a size, but no contents. 487 // Zero-fill sections have a size, but no contents.
486 section.contents.start = section.contents.end = NULL; 488 section.contents.start = section.contents.end = NULL;
487 } else if (segment.contents.start == NULL && 489 } else if (segment.contents.start == NULL &&
488 segment.contents.end == NULL) { 490 segment.contents.end == NULL) {
489 // Mach-O files in .dSYM bundles have the contents of the loaded 491 // Mach-O files in .dSYM bundles have the contents of the loaded
490 // segments removed, and their file offsets and file sizes zeroed 492 // segments removed, and their file offsets and file sizes zeroed
491 // out. However, the sections within those segments still have 493 // out. However, the sections within those segments still have
492 // non-zero sizes. There's no reason to call MisplacedSectionData in 494 // non-zero sizes. There's no reason to call MisplacedSectionData in
493 // this case; the caller may just need the section's load 495 // this case; the caller may just need the section's load
494 // address. But do set the contents' limits to NULL, for safety. 496 // address. But do set the contents' limits to NULL, for safety.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 530
529 bool Reader::MapSegmentSections(const Segment &segment, 531 bool Reader::MapSegmentSections(const Segment &segment,
530 SectionMap *section_map) const { 532 SectionMap *section_map) const {
531 section_map->clear(); 533 section_map->clear();
532 SectionMapper mapper(section_map); 534 SectionMapper mapper(section_map);
533 return WalkSegmentSections(segment, &mapper); 535 return WalkSegmentSections(segment, &mapper);
534 } 536 }
535 537
536 } // namespace mach_o 538 } // namespace mach_o
537 } // namespace google_breakpad 539 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698