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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 // The minor device number. | 885 // The minor device number. |
886 uint8_t GetMinorDevice() const { return valid_ ? region_.minor_device : 0; } | 886 uint8_t GetMinorDevice() const { return valid_ ? region_.minor_device : 0; } |
887 | 887 |
888 // The inode of the mapped region. | 888 // The inode of the mapped region. |
889 uint64_t GetInode() const { return valid_ ? region_.inode : 0; } | 889 uint64_t GetInode() const { return valid_ ? region_.inode : 0; } |
890 | 890 |
891 // The pathname of the mapped region. | 891 // The pathname of the mapped region. |
892 const string GetPathname() const { return valid_ ? region_.path : ""; } | 892 const string GetPathname() const { return valid_ ? region_.path : ""; } |
893 | 893 |
894 // Print the contents of this mapping. | 894 // Print the contents of this mapping. |
895 void Print(); | 895 void Print() const; |
896 | 896 |
897 private: | 897 private: |
898 // These objects are managed by MinidumpLinuxMapsList. | 898 // These objects are managed by MinidumpLinuxMapsList. |
899 friend class MinidumpLinuxMapsList; | 899 friend class MinidumpLinuxMapsList; |
900 | 900 |
901 // This caller owns the pointer. | 901 // This caller owns the pointer. |
902 explicit MinidumpLinuxMaps(Minidump *minidump); | 902 explicit MinidumpLinuxMaps(Minidump *minidump); |
903 | 903 |
904 // The memory region struct that this class wraps. | 904 // The memory region struct that this class wraps. |
905 MappedMemoryRegion region_; | 905 MappedMemoryRegion region_; |
906 | 906 |
907 DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps); | 907 DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps); |
908 }; | 908 }; |
909 | 909 |
910 // MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS | 910 // MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS |
911 // stream, which contains the contents of /prod/self/maps, which contains | 911 // stream, which contains the contents of /prod/self/maps, which contains |
912 // the mapped memory regions and their access permissions. | 912 // the mapped memory regions and their access permissions. |
913 class MinidumpLinuxMapsList : public MinidumpStream { | 913 class MinidumpLinuxMapsList : public MinidumpStream { |
914 public: | 914 public: |
915 virtual ~MinidumpLinuxMapsList(); | 915 virtual ~MinidumpLinuxMapsList(); |
916 | 916 |
917 // Get mapping at the given memory address. The caller owns the pointer. | 917 // Get mapping at the given memory address. The caller owns the pointer. |
918 const MinidumpLinuxMaps *GetLinuxMapsForAddress(uint64_t address) const; | 918 const MinidumpLinuxMaps *GetLinuxMapsForAddress(uint64_t address) const; |
919 // Get mapping at the given index. The caller owns the pointer. | 919 // Get mapping at the given index. The caller owns the pointer. |
920 const MinidumpLinuxMaps *GetLinuxMapsAtIndex(unsigned int index) const; | 920 const MinidumpLinuxMaps *GetLinuxMapsAtIndex(unsigned int index) const; |
921 | 921 |
922 // Print the contents of /proc/self/maps to stdout. | 922 // Print the contents of /proc/self/maps to stdout. |
923 void Print(); | 923 void Print() const; |
924 | 924 |
925 private: | 925 private: |
926 friend class Minidump; | 926 friend class Minidump; |
927 | 927 |
928 typedef vector<MinidumpLinuxMaps *> MinidumpLinuxMappings; | 928 typedef vector<MinidumpLinuxMaps *> MinidumpLinuxMappings; |
929 | 929 |
930 static const uint32_t kStreamType = MD_LINUX_MAPS; | 930 static const uint32_t kStreamType = MD_LINUX_MAPS; |
931 | 931 |
932 // The caller owns the pointer. | 932 // The caller owns the pointer. |
933 explicit MinidumpLinuxMapsList(Minidump *minidump); | 933 explicit MinidumpLinuxMapsList(Minidump *minidump); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 // construction or after a failed Read(); true following a successful | 1116 // construction or after a failed Read(); true following a successful |
1117 // Read(). | 1117 // Read(). |
1118 bool valid_; | 1118 bool valid_; |
1119 }; | 1119 }; |
1120 | 1120 |
1121 | 1121 |
1122 } // namespace google_breakpad | 1122 } // namespace google_breakpad |
1123 | 1123 |
1124 | 1124 |
1125 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__ | 1125 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__ |
OLD | NEW |