42 "malformed /proc/{pid}/%s entry, missing dash between address range",
51 "malformed /proc/{pid}/%s entry, missing space after range", maps_kind);
64 "malformed /proc/{pid}/%s entry, missing some portion of "
69 const char read_perm_char = line_extractor.
GetChar();
70 if (read_perm_char ==
'r')
72 else if (read_perm_char ==
'-')
75 return ProcMapError(
"unexpected /proc/{pid}/%s read permission char",
79 const char write_perm_char = line_extractor.
GetChar();
80 if (write_perm_char ==
'w')
82 else if (write_perm_char ==
'-')
85 return ProcMapError(
"unexpected /proc/{pid}/%s write permission char",
89 const char exec_perm_char = line_extractor.
GetChar();
90 if (exec_perm_char ==
'x')
92 else if (exec_perm_char ==
'-')
95 return ProcMapError(
"unexpected /proc/{pid}/%s exec permission char",
99 const char sharing_char = line_extractor.
GetChar();
100 if (sharing_char ==
's')
102 else if (sharing_char ==
'p')
113 line_extractor.
GetU64(0, 10);
116 const char *name = line_extractor.
Peek();
148 llvm::StringRef lines(linux_smap);
149 llvm::StringRef line;
150 std::optional<MemoryRegionInfo> region;
152 while (lines.size()) {
153 std::tie(line, lines) = lines.split(
'\n');
159 llvm::StringRef name;
160 llvm::StringRef value;
161 std::tie(name, value) = line.split(
':');
164 if (!name.contains(
' ')) {
166 if (name ==
"VmFlags") {
170 llvm::SmallVector<llvm::StringRef> flags;
171 value.split(flags,
' ', -1,
false);
172 for (llvm::StringRef flag : flags)
175 else if (flag ==
"ss")
177 }
else if (name ==
"ProtectionKey") {
179 if (!value.ltrim().getAsInteger(10, key))
180 region->SetProtectionKey(key);
185 "Found a property line without a corresponding mapping "
199 llvm::Expected<MemoryRegionInfo> new_region =
202 region = *new_region;
205 callback(new_region.takeError());