OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_ | 5 #ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_ |
6 #define BASE_DEBUG_PROC_MAPS_LINUX_H_ | 6 #define BASE_DEBUG_PROC_MAPS_LINUX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "common/using_std_string.h" | 11 #include "common/using_std_string.h" |
12 #include "google_breakpad/common/breakpad_types.h" | 12 #include "google_breakpad/common/breakpad_types.h" |
13 | 13 |
14 namespace google_breakpad { | 14 namespace google_breakpad { |
15 | 15 |
16 // Describes a region of mapped memory and the path of the file mapped. | 16 // Describes a region of mapped memory and the path of the file mapped. |
17 struct MappedMemoryRegion { | 17 struct MappedMemoryRegion { |
18 enum Permission { | 18 enum Permission { |
19 READ = 1 << 0, | 19 READ = 1 << 0, |
20 WRITE = 1 << 1, | 20 WRITE = 1 << 1, |
21 EXECUTE = 1 << 2, | 21 EXECUTE = 1 << 2, |
22 PRIVATE = 1 << 3, // If set, region is private, otherwise it is shared. | 22 PRIVATE = 1 << 3, // If set, region is private, otherwise it is shared. |
23 }; | 23 }; |
24 | 24 |
25 // The address range [start,end) of mapped memory. | 25 // The address range [start,end) of mapped memory. |
26 uintptr_t start; | 26 uint64_t start; |
27 uintptr_t end; | 27 uint64_t end; |
28 | 28 |
29 // Byte offset into |path| of the range mapped into memory. | 29 // Byte offset into |path| of the range mapped into memory. |
30 uint64_t offset; | 30 uint64_t offset; |
31 | 31 |
32 // Bitmask of read/write/execute/private/shared permissions. | 32 // Bitmask of read/write/execute/private/shared permissions. |
33 uint8_t permissions; | 33 uint8_t permissions; |
34 | 34 |
35 // Major and minor devices. | 35 // Major and minor devices. |
36 uint8_t major_device; | 36 uint8_t major_device; |
37 uint8_t minor_device; | 37 uint8_t minor_device; |
(...skipping 13 matching lines...) Expand all Loading... |
51 }; | 51 }; |
52 | 52 |
53 // Parses /proc/<pid>/maps input data and stores in |regions|. Returns true | 53 // Parses /proc/<pid>/maps input data and stores in |regions|. Returns true |
54 // and updates |regions| if and only if all of |input| was successfully parsed. | 54 // and updates |regions| if and only if all of |input| was successfully parsed. |
55 bool ParseProcMaps(const std::string& input, | 55 bool ParseProcMaps(const std::string& input, |
56 std::vector<MappedMemoryRegion>* regions); | 56 std::vector<MappedMemoryRegion>* regions); |
57 | 57 |
58 } // namespace google_breakpad | 58 } // namespace google_breakpad |
59 | 59 |
60 #endif // BASE_DEBUG_PROC_MAPS_LINUX_H_ | 60 #endif // BASE_DEBUG_PROC_MAPS_LINUX_H_ |
OLD | NEW |