OLD | NEW |
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 private: | 145 private: |
146 // Populate (and validate) the MinidumpStream. minidump_ is expected | 146 // Populate (and validate) the MinidumpStream. minidump_ is expected |
147 // to be positioned at the beginning of the stream, so that the next | 147 // to be positioned at the beginning of the stream, so that the next |
148 // read from the minidump will be at the beginning of the stream. | 148 // read from the minidump will be at the beginning of the stream. |
149 // expected_size should be set to the stream's length as contained in | 149 // expected_size should be set to the stream's length as contained in |
150 // the MDRawDirectory record or other identifying record. A class | 150 // the MDRawDirectory record or other identifying record. A class |
151 // that implements MinidumpStream can compare expected_size to a | 151 // that implements MinidumpStream can compare expected_size to a |
152 // known size as an integrity check. | 152 // known size as an integrity check. |
153 virtual bool Read(uint32_t expected_size) = 0; | 153 virtual bool Read(uint32_t expected_size) = 0; |
| 154 |
| 155 DISALLOW_COPY_AND_ASSIGN(MinidumpStream); |
154 }; | 156 }; |
155 | 157 |
156 | 158 |
157 // MinidumpContext carries a CPU-specific MDRawContext structure, which | 159 // MinidumpContext carries a CPU-specific MDRawContext structure, which |
158 // contains CPU context such as register states. Each thread has its | 160 // contains CPU context such as register states. Each thread has its |
159 // own context, and the exception record, if present, also has its own | 161 // own context, and the exception record, if present, also has its own |
160 // context. Note that if the exception record is present, the context it | 162 // context. Note that if the exception record is present, the context it |
161 // refers to is probably what the user wants to use for the exception | 163 // refers to is probably what the user wants to use for the exception |
162 // thread, instead of that thread's own context. The exception thread's | 164 // thread, instead of that thread's own context. The exception thread's |
163 // context (as opposed to the exception record's context) will contain | 165 // context (as opposed to the exception record's context) will contain |
(...skipping 20 matching lines...) Expand all Loading... |
184 // not contain a system info stream. | 186 // not contain a system info stream. |
185 bool CheckAgainstSystemInfo(uint32_t context_cpu_type); | 187 bool CheckAgainstSystemInfo(uint32_t context_cpu_type); |
186 | 188 |
187 // Refers to the Minidump object that is the ultimate parent of this | 189 // Refers to the Minidump object that is the ultimate parent of this |
188 // Some MinidumpObjects are owned by other MinidumpObjects, but at the | 190 // Some MinidumpObjects are owned by other MinidumpObjects, but at the |
189 // root of the ownership tree is always a Minidump. The Minidump object | 191 // root of the ownership tree is always a Minidump. The Minidump object |
190 // is kept here for access to its seeking and reading facilities, and | 192 // is kept here for access to its seeking and reading facilities, and |
191 // for access to data about the minidump file itself, such as whether | 193 // for access to data about the minidump file itself, such as whether |
192 // it should be byte-swapped. | 194 // it should be byte-swapped. |
193 Minidump* minidump_; | 195 Minidump* minidump_; |
| 196 |
| 197 DISALLOW_COPY_AND_ASSIGN(MinidumpContext); |
194 }; | 198 }; |
195 | 199 |
196 | 200 |
197 // MinidumpMemoryRegion does not wrap any MDRaw structure, and only contains | 201 // MinidumpMemoryRegion does not wrap any MDRaw structure, and only contains |
198 // a reference to an MDMemoryDescriptor. This object is intended to wrap | 202 // a reference to an MDMemoryDescriptor. This object is intended to wrap |
199 // portions of a minidump file that contain memory dumps. In normal | 203 // portions of a minidump file that contain memory dumps. In normal |
200 // minidumps, each MinidumpThread owns a MinidumpMemoryRegion corresponding | 204 // minidumps, each MinidumpThread owns a MinidumpMemoryRegion corresponding |
201 // to the thread's stack memory. MinidumpMemoryList also gives access to | 205 // to the thread's stack memory. MinidumpMemoryList also gives access to |
202 // memory regions in its list as MinidumpMemoryRegions. This class | 206 // memory regions in its list as MinidumpMemoryRegions. This class |
203 // adheres to MemoryRegion so that it may be used as a data provider to | 207 // adheres to MemoryRegion so that it may be used as a data provider to |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // The largest number of threads that will be read from a minidump. The | 355 // The largest number of threads that will be read from a minidump. The |
352 // default is 256. | 356 // default is 256. |
353 static uint32_t max_threads_; | 357 static uint32_t max_threads_; |
354 | 358 |
355 // Access to threads using the thread ID as the key. | 359 // Access to threads using the thread ID as the key. |
356 IDToThreadMap id_to_thread_map_; | 360 IDToThreadMap id_to_thread_map_; |
357 | 361 |
358 // The list of threads. | 362 // The list of threads. |
359 MinidumpThreads* threads_; | 363 MinidumpThreads* threads_; |
360 uint32_t thread_count_; | 364 uint32_t thread_count_; |
| 365 |
| 366 DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList); |
361 }; | 367 }; |
362 | 368 |
363 | 369 |
364 // MinidumpModule wraps MDRawModule, which contains information about loaded | 370 // MinidumpModule wraps MDRawModule, which contains information about loaded |
365 // code modules. Access is provided to various data referenced indirectly | 371 // code modules. Access is provided to various data referenced indirectly |
366 // by MDRawModule, such as the module's name and a specification for where | 372 // by MDRawModule, such as the module's name and a specification for where |
367 // to locate debugging information for the module. | 373 // to locate debugging information for the module. |
368 class MinidumpModule : public MinidumpObject, | 374 class MinidumpModule : public MinidumpObject, |
369 public CodeModule { | 375 public CodeModule { |
370 public: | 376 public: |
(...skipping 14 matching lines...) Expand all Loading... |
385 // CodeModule implementation | 391 // CodeModule implementation |
386 virtual uint64_t base_address() const { | 392 virtual uint64_t base_address() const { |
387 return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1); | 393 return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1); |
388 } | 394 } |
389 virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; } | 395 virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; } |
390 virtual string code_file() const; | 396 virtual string code_file() const; |
391 virtual string code_identifier() const; | 397 virtual string code_identifier() const; |
392 virtual string debug_file() const; | 398 virtual string debug_file() const; |
393 virtual string debug_identifier() const; | 399 virtual string debug_identifier() const; |
394 virtual string version() const; | 400 virtual string version() const; |
395 virtual const CodeModule* Copy() const; | 401 virtual CodeModule* Copy() const; |
| 402 |
| 403 // Getter and setter for shrink_down_delta. This is used when the address |
| 404 // range for a module is shrunk down due to address range conflicts with |
| 405 // other modules. The base_address and size fields are not updated and they |
| 406 // should always reflect the original values (reported in the minidump). |
| 407 virtual uint64_t shrink_down_delta() const; |
| 408 virtual void SetShrinkDownDelta(uint64_t shrink_down_delta); |
396 | 409 |
397 // The CodeView record, which contains information to locate the module's | 410 // The CodeView record, which contains information to locate the module's |
398 // debugging information (pdb). This is returned as uint8_t* because | 411 // debugging information (pdb). This is returned as uint8_t* because |
399 // the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be | 412 // the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be |
400 // of a type unknown to Breakpad, in which case the raw data will still be | 413 // of a type unknown to Breakpad, in which case the raw data will still be |
401 // returned but no byte-swapping will have been performed. Check the | 414 // returned but no byte-swapping will have been performed. Check the |
402 // record's signature in the first four bytes to differentiate between | 415 // record's signature in the first four bytes to differentiate between |
403 // the various types. Current toolchains generate modules which carry | 416 // the various types. Current toolchains generate modules which carry |
404 // MDCVInfoPDB70 by default. Returns a pointer to the CodeView record on | 417 // MDCVInfoPDB70 by default. Returns a pointer to the CodeView record on |
405 // success, and NULL on failure. On success, the optional |size| argument | 418 // success, and NULL on failure. On success, the optional |size| argument |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 virtual unsigned int module_count() const { | 507 virtual unsigned int module_count() const { |
495 return valid_ ? module_count_ : 0; | 508 return valid_ ? module_count_ : 0; |
496 } | 509 } |
497 virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const; | 510 virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const; |
498 virtual const MinidumpModule* GetMainModule() const; | 511 virtual const MinidumpModule* GetMainModule() const; |
499 virtual const MinidumpModule* GetModuleAtSequence( | 512 virtual const MinidumpModule* GetModuleAtSequence( |
500 unsigned int sequence) const; | 513 unsigned int sequence) const; |
501 virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const; | 514 virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const; |
502 virtual const CodeModules* Copy() const; | 515 virtual const CodeModules* Copy() const; |
503 | 516 |
| 517 // Returns a vector of all modules which address ranges needed to be shrunk |
| 518 // down due to address range conflicts with other modules. |
| 519 virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const; |
| 520 |
| 521 // Returns true, if module address range shrink is enabled. |
| 522 virtual bool IsModuleShrinkEnabled() const; |
| 523 |
504 // Print a human-readable representation of the object to stdout. | 524 // Print a human-readable representation of the object to stdout. |
505 void Print(); | 525 void Print(); |
506 | 526 |
507 protected: | 527 protected: |
508 explicit MinidumpModuleList(Minidump* minidump); | 528 explicit MinidumpModuleList(Minidump* minidump); |
509 | 529 |
510 private: | 530 private: |
511 friend class Minidump; | 531 friend class Minidump; |
512 | 532 |
513 typedef vector<MinidumpModule> MinidumpModules; | 533 typedef vector<MinidumpModule> MinidumpModules; |
514 | 534 |
515 static const uint32_t kStreamType = MD_MODULE_LIST_STREAM; | 535 static const uint32_t kStreamType = MD_MODULE_LIST_STREAM; |
516 | 536 |
517 bool Read(uint32_t expected_size); | 537 bool Read(uint32_t expected_size); |
518 | 538 |
519 // The largest number of modules that will be read from a minidump. The | 539 // The largest number of modules that will be read from a minidump. The |
520 // default is 1024. | 540 // default is 1024. |
521 static uint32_t max_modules_; | 541 static uint32_t max_modules_; |
522 | 542 |
523 // Access to modules using addresses as the key. | 543 // Access to modules using addresses as the key. |
524 RangeMap<uint64_t, unsigned int> *range_map_; | 544 RangeMap<uint64_t, unsigned int> *range_map_; |
525 | 545 |
526 MinidumpModules *modules_; | 546 MinidumpModules *modules_; |
527 uint32_t module_count_; | 547 uint32_t module_count_; |
| 548 |
| 549 DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList); |
528 }; | 550 }; |
529 | 551 |
530 | 552 |
531 // MinidumpMemoryList corresponds to a minidump's MEMORY_LIST_STREAM stream, | 553 // MinidumpMemoryList corresponds to a minidump's MEMORY_LIST_STREAM stream, |
532 // which references the snapshots of all of the memory regions contained | 554 // which references the snapshots of all of the memory regions contained |
533 // within the minidump. For a normal minidump, this includes stack memory | 555 // within the minidump. For a normal minidump, this includes stack memory |
534 // (also referenced by each MinidumpThread, in fact, the MDMemoryDescriptors | 556 // (also referenced by each MinidumpThread, in fact, the MDMemoryDescriptors |
535 // here and in MDRawThread both point to exactly the same data in a | 557 // here and in MDRawThread both point to exactly the same data in a |
536 // minidump file, conserving space), as well as a 256-byte snapshot of memory | 558 // minidump file, conserving space), as well as a 256-byte snapshot of memory |
537 // surrounding the instruction pointer in the case of an exception. Other | 559 // surrounding the instruction pointer in the case of an exception. Other |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 602 |
581 // The list of descriptors. This is maintained separately from the list | 603 // The list of descriptors. This is maintained separately from the list |
582 // of regions, because MemoryRegion doesn't own its MemoryDescriptor, it | 604 // of regions, because MemoryRegion doesn't own its MemoryDescriptor, it |
583 // maintains a pointer to it. descriptors_ provides the storage for this | 605 // maintains a pointer to it. descriptors_ provides the storage for this |
584 // purpose. | 606 // purpose. |
585 MemoryDescriptors *descriptors_; | 607 MemoryDescriptors *descriptors_; |
586 | 608 |
587 // The list of regions. | 609 // The list of regions. |
588 MemoryRegions *regions_; | 610 MemoryRegions *regions_; |
589 uint32_t region_count_; | 611 uint32_t region_count_; |
| 612 |
| 613 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList); |
590 }; | 614 }; |
591 | 615 |
592 | 616 |
593 // MinidumpException wraps MDRawExceptionStream, which contains information | 617 // MinidumpException wraps MDRawExceptionStream, which contains information |
594 // about the exception that caused the minidump to be generated, if the | 618 // about the exception that caused the minidump to be generated, if the |
595 // minidump was generated in an exception handler called as a result of an | 619 // minidump was generated in an exception handler called as a result of an |
596 // exception. It also provides access to a MinidumpContext object, which | 620 // exception. It also provides access to a MinidumpContext object, which |
597 // contains the CPU context for the exception thread at the time the exception | 621 // contains the CPU context for the exception thread at the time the exception |
598 // occurred. | 622 // occurred. |
599 class MinidumpException : public MinidumpStream { | 623 class MinidumpException : public MinidumpStream { |
(...skipping 19 matching lines...) Expand all Loading... |
619 friend class Minidump; | 643 friend class Minidump; |
620 | 644 |
621 static const uint32_t kStreamType = MD_EXCEPTION_STREAM; | 645 static const uint32_t kStreamType = MD_EXCEPTION_STREAM; |
622 | 646 |
623 explicit MinidumpException(Minidump* minidump); | 647 explicit MinidumpException(Minidump* minidump); |
624 | 648 |
625 bool Read(uint32_t expected_size); | 649 bool Read(uint32_t expected_size); |
626 | 650 |
627 MDRawExceptionStream exception_; | 651 MDRawExceptionStream exception_; |
628 MinidumpContext* context_; | 652 MinidumpContext* context_; |
| 653 |
| 654 DISALLOW_COPY_AND_ASSIGN(MinidumpException); |
629 }; | 655 }; |
630 | 656 |
631 // MinidumpAssertion wraps MDRawAssertionInfo, which contains information | 657 // MinidumpAssertion wraps MDRawAssertionInfo, which contains information |
632 // about an assertion that caused the minidump to be generated. | 658 // about an assertion that caused the minidump to be generated. |
633 class MinidumpAssertion : public MinidumpStream { | 659 class MinidumpAssertion : public MinidumpStream { |
634 public: | 660 public: |
635 virtual ~MinidumpAssertion(); | 661 virtual ~MinidumpAssertion(); |
636 | 662 |
637 const MDRawAssertionInfo* assertion() const { | 663 const MDRawAssertionInfo* assertion() const { |
638 return valid_ ? &assertion_ : NULL; | 664 return valid_ ? &assertion_ : NULL; |
(...skipping 20 matching lines...) Expand all Loading... |
659 static const uint32_t kStreamType = MD_ASSERTION_INFO_STREAM; | 685 static const uint32_t kStreamType = MD_ASSERTION_INFO_STREAM; |
660 | 686 |
661 explicit MinidumpAssertion(Minidump* minidump); | 687 explicit MinidumpAssertion(Minidump* minidump); |
662 | 688 |
663 bool Read(uint32_t expected_size); | 689 bool Read(uint32_t expected_size); |
664 | 690 |
665 MDRawAssertionInfo assertion_; | 691 MDRawAssertionInfo assertion_; |
666 string expression_; | 692 string expression_; |
667 string function_; | 693 string function_; |
668 string file_; | 694 string file_; |
| 695 |
| 696 DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion); |
669 }; | 697 }; |
670 | 698 |
671 | 699 |
672 // MinidumpSystemInfo wraps MDRawSystemInfo and provides information about | 700 // MinidumpSystemInfo wraps MDRawSystemInfo and provides information about |
673 // the system on which the minidump was generated. See also MinidumpMiscInfo. | 701 // the system on which the minidump was generated. See also MinidumpMiscInfo. |
674 class MinidumpSystemInfo : public MinidumpStream { | 702 class MinidumpSystemInfo : public MinidumpStream { |
675 public: | 703 public: |
676 virtual ~MinidumpSystemInfo(); | 704 virtual ~MinidumpSystemInfo(); |
677 | 705 |
678 const MDRawSystemInfo* system_info() const { | 706 const MDRawSystemInfo* system_info() const { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 | 740 |
713 private: | 741 private: |
714 friend class Minidump; | 742 friend class Minidump; |
715 | 743 |
716 static const uint32_t kStreamType = MD_SYSTEM_INFO_STREAM; | 744 static const uint32_t kStreamType = MD_SYSTEM_INFO_STREAM; |
717 | 745 |
718 bool Read(uint32_t expected_size); | 746 bool Read(uint32_t expected_size); |
719 | 747 |
720 // A string identifying the CPU vendor, if known. | 748 // A string identifying the CPU vendor, if known. |
721 const string* cpu_vendor_; | 749 const string* cpu_vendor_; |
| 750 |
| 751 DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo); |
722 }; | 752 }; |
723 | 753 |
724 | 754 |
725 // MinidumpMiscInfo wraps MDRawMiscInfo and provides information about | 755 // MinidumpMiscInfo wraps MDRawMiscInfo and provides information about |
726 // the process that generated the minidump, and optionally additional system | 756 // the process that generated the minidump, and optionally additional system |
727 // information. See also MinidumpSystemInfo. | 757 // information. See also MinidumpSystemInfo. |
728 class MinidumpMiscInfo : public MinidumpStream { | 758 class MinidumpMiscInfo : public MinidumpStream { |
729 public: | 759 public: |
730 const MDRawMiscInfo* misc_info() const { | 760 const MDRawMiscInfo* misc_info() const { |
731 return valid_ ? &misc_info_ : NULL; | 761 return valid_ ? &misc_info_ : NULL; |
(...skipping 13 matching lines...) Expand all Loading... |
745 bool Read(uint32_t expected_size_); | 775 bool Read(uint32_t expected_size_); |
746 | 776 |
747 MDRawMiscInfo misc_info_; | 777 MDRawMiscInfo misc_info_; |
748 | 778 |
749 // Populated by Read. Contains the converted strings from the corresponding | 779 // Populated by Read. Contains the converted strings from the corresponding |
750 // UTF-16 fields in misc_info_ | 780 // UTF-16 fields in misc_info_ |
751 string standard_name_; | 781 string standard_name_; |
752 string daylight_name_; | 782 string daylight_name_; |
753 string build_string_; | 783 string build_string_; |
754 string dbg_bld_str_; | 784 string dbg_bld_str_; |
| 785 |
| 786 DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo); |
755 }; | 787 }; |
756 | 788 |
757 | 789 |
758 // MinidumpBreakpadInfo wraps MDRawBreakpadInfo, which is an optional stream in | 790 // MinidumpBreakpadInfo wraps MDRawBreakpadInfo, which is an optional stream in |
759 // a minidump that provides additional information about the process state | 791 // a minidump that provides additional information about the process state |
760 // at the time the minidump was generated. | 792 // at the time the minidump was generated. |
761 class MinidumpBreakpadInfo : public MinidumpStream { | 793 class MinidumpBreakpadInfo : public MinidumpStream { |
762 public: | 794 public: |
763 const MDRawBreakpadInfo* breakpad_info() const { | 795 const MDRawBreakpadInfo* breakpad_info() const { |
764 return valid_ ? &breakpad_info_ : NULL; | 796 return valid_ ? &breakpad_info_ : NULL; |
(...skipping 12 matching lines...) Expand all Loading... |
777 private: | 809 private: |
778 friend class Minidump; | 810 friend class Minidump; |
779 | 811 |
780 static const uint32_t kStreamType = MD_BREAKPAD_INFO_STREAM; | 812 static const uint32_t kStreamType = MD_BREAKPAD_INFO_STREAM; |
781 | 813 |
782 explicit MinidumpBreakpadInfo(Minidump* minidump_); | 814 explicit MinidumpBreakpadInfo(Minidump* minidump_); |
783 | 815 |
784 bool Read(uint32_t expected_size_); | 816 bool Read(uint32_t expected_size_); |
785 | 817 |
786 MDRawBreakpadInfo breakpad_info_; | 818 MDRawBreakpadInfo breakpad_info_; |
| 819 |
| 820 DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo); |
787 }; | 821 }; |
788 | 822 |
789 // MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information | 823 // MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information |
790 // about mapped memory regions in a process, including their ranges | 824 // about mapped memory regions in a process, including their ranges |
791 // and protection. | 825 // and protection. |
792 class MinidumpMemoryInfo : public MinidumpObject { | 826 class MinidumpMemoryInfo : public MinidumpObject { |
793 public: | 827 public: |
794 const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; } | 828 const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; } |
795 | 829 |
796 // The address of the base of the memory region. | 830 // The address of the base of the memory region. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 | 881 |
848 explicit MinidumpMemoryInfoList(Minidump* minidump_); | 882 explicit MinidumpMemoryInfoList(Minidump* minidump_); |
849 | 883 |
850 bool Read(uint32_t expected_size); | 884 bool Read(uint32_t expected_size); |
851 | 885 |
852 // Access to memory info using addresses as the key. | 886 // Access to memory info using addresses as the key. |
853 RangeMap<uint64_t, unsigned int> *range_map_; | 887 RangeMap<uint64_t, unsigned int> *range_map_; |
854 | 888 |
855 MinidumpMemoryInfos* infos_; | 889 MinidumpMemoryInfos* infos_; |
856 uint32_t info_count_; | 890 uint32_t info_count_; |
| 891 |
| 892 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList); |
857 }; | 893 }; |
858 | 894 |
859 // MinidumpLinuxMaps wraps information about a single mapped memory region | 895 // MinidumpLinuxMaps wraps information about a single mapped memory region |
860 // from /proc/self/maps. | 896 // from /proc/self/maps. |
861 class MinidumpLinuxMaps : public MinidumpObject { | 897 class MinidumpLinuxMaps : public MinidumpObject { |
862 public: | 898 public: |
863 // The memory address of the base of the mapped region. | 899 // The memory address of the base of the mapped region. |
864 uint64_t GetBase() const { return valid_ ? region_.start : 0; } | 900 uint64_t GetBase() const { return valid_ ? region_.start : 0; } |
865 // The size of the mapped region. | 901 // The size of the mapped region. |
866 uint64_t GetSize() const { return valid_ ? region_.end - region_.start : 0; } | 902 uint64_t GetSize() const { return valid_ ? region_.end - region_.start : 0; } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 // possibility, and consider using GetDirectoryEntryAtIndex (possibly | 1090 // possibility, and consider using GetDirectoryEntryAtIndex (possibly |
1055 // with GetDirectoryEntryCount) if expecting multiple streams of the same | 1091 // with GetDirectoryEntryCount) if expecting multiple streams of the same |
1056 // type in a single minidump file. | 1092 // type in a single minidump file. |
1057 bool SeekToStreamType(uint32_t stream_type, uint32_t* stream_length); | 1093 bool SeekToStreamType(uint32_t stream_type, uint32_t* stream_length); |
1058 | 1094 |
1059 bool swap() const { return valid_ ? swap_ : false; } | 1095 bool swap() const { return valid_ ? swap_ : false; } |
1060 | 1096 |
1061 // Print a human-readable representation of the object to stdout. | 1097 // Print a human-readable representation of the object to stdout. |
1062 void Print(); | 1098 void Print(); |
1063 | 1099 |
| 1100 // Is the OS Android. |
| 1101 bool IsAndroid(); |
| 1102 |
1064 private: | 1103 private: |
1065 // MinidumpStreamInfo is used in the MinidumpStreamMap. It lets | 1104 // MinidumpStreamInfo is used in the MinidumpStreamMap. It lets |
1066 // the Minidump object locate interesting streams quickly, and | 1105 // the Minidump object locate interesting streams quickly, and |
1067 // provides a convenient place to stash MinidumpStream objects. | 1106 // provides a convenient place to stash MinidumpStream objects. |
1068 struct MinidumpStreamInfo { | 1107 struct MinidumpStreamInfo { |
1069 MinidumpStreamInfo() : stream_index(0), stream(NULL) {} | 1108 MinidumpStreamInfo() : stream_index(0), stream(NULL) {} |
1070 ~MinidumpStreamInfo() { delete stream; } | 1109 ~MinidumpStreamInfo() { delete stream; } |
1071 | 1110 |
1072 // Index into the MinidumpDirectoryEntries vector | 1111 // Index into the MinidumpDirectoryEntries vector |
1073 unsigned int stream_index; | 1112 unsigned int stream_index; |
1074 | 1113 |
1075 // Pointer to the stream if cached, or NULL if not yet populated | 1114 // Pointer to the stream if cached, or NULL if not yet populated |
1076 MinidumpStream* stream; | 1115 MinidumpStream* stream; |
| 1116 |
| 1117 private: |
| 1118 DISALLOW_COPY_AND_ASSIGN(MinidumpStreamInfo); |
1077 }; | 1119 }; |
1078 | 1120 |
1079 typedef vector<MDRawDirectory> MinidumpDirectoryEntries; | 1121 typedef vector<MDRawDirectory> MinidumpDirectoryEntries; |
1080 typedef map<uint32_t, MinidumpStreamInfo> MinidumpStreamMap; | 1122 typedef map<uint32_t, MinidumpStreamInfo> MinidumpStreamMap; |
1081 | 1123 |
1082 template<typename T> T* GetStream(T** stream); | 1124 template<typename T> T* GetStream(T** stream); |
1083 | 1125 |
1084 // Opens the minidump file, or if already open, seeks to the beginning. | 1126 // Opens the minidump file, or if already open, seeks to the beginning. |
1085 bool Open(); | 1127 bool Open(); |
1086 | 1128 |
(...skipping 27 matching lines...) Expand all Loading... |
1114 // swap_ is true if the minidump file should be byte-swapped. If the | 1156 // swap_ is true if the minidump file should be byte-swapped. If the |
1115 // minidump was produced by a CPU that is other-endian than the CPU | 1157 // minidump was produced by a CPU that is other-endian than the CPU |
1116 // processing the minidump, this will be true. If the two CPUs are | 1158 // processing the minidump, this will be true. If the two CPUs are |
1117 // same-endian, this will be false. | 1159 // same-endian, this will be false. |
1118 bool swap_; | 1160 bool swap_; |
1119 | 1161 |
1120 // Validity of the Minidump structure, false immediately after | 1162 // Validity of the Minidump structure, false immediately after |
1121 // construction or after a failed Read(); true following a successful | 1163 // construction or after a failed Read(); true following a successful |
1122 // Read(). | 1164 // Read(). |
1123 bool valid_; | 1165 bool valid_; |
| 1166 |
| 1167 DISALLOW_COPY_AND_ASSIGN(Minidump); |
1124 }; | 1168 }; |
1125 | 1169 |
1126 | 1170 |
1127 } // namespace google_breakpad | 1171 } // namespace google_breakpad |
1128 | 1172 |
1129 | 1173 |
1130 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__ | 1174 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__ |
OLD | NEW |