Skip to content

Commit c8f166c

Browse files
committed
Address Omair's comments
1 parent 17f7ee6 commit c8f166c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,10 +2802,11 @@ GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfo(
28022802
if (memory_tagged != MemoryRegionInfo::eDontKnow ||
28032803
is_shadow_stack != MemoryRegionInfo::eDontKnow) {
28042804
response.PutCString("flags:");
2805+
// Space is the separator.
28052806
if (memory_tagged == MemoryRegionInfo::eYes)
2806-
response.PutCString("mt");
2807+
response.PutCString("mt ");
28072808
if (is_shadow_stack == MemoryRegionInfo::eYes)
2808-
response.PutCString("ss");
2809+
response.PutCString("ss ");
28092810

28102811
response.PutChar(';');
28112812
}

lldb/unittests/Process/Utility/LinuxProcMapsTest.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,21 @@ INSTANTIATE_TEST_SUITE_P(
292292
MemoryRegionInfo::eDontKnow, MemoryRegionInfo::eDontKnow,
293293
MemoryRegionInfo::eDontKnow),
294294
},
295+
""),
296+
// We must look for exact flag strings, ignoring substrings of longer
297+
// flag names.
298+
std::make_tuple(
299+
"0-0 rw-p 00000000 00:00 0\n"
300+
"VmFlags: amt mtb amtb",
301+
MemoryRegionInfos{
302+
MemoryRegionInfo(
303+
make_range(0, 0), MemoryRegionInfo::eYes,
304+
MemoryRegionInfo::eYes, MemoryRegionInfo::eNo,
305+
MemoryRegionInfo::eNo, MemoryRegionInfo::eYes,
306+
ConstString(nullptr), MemoryRegionInfo::eDontKnow, 0,
307+
MemoryRegionInfo::eNo, MemoryRegionInfo::eDontKnow,
308+
MemoryRegionInfo::eNo),
309+
},
295310
"")));
296311

297312
TEST_P(LinuxProcSMapsTestFixture, ParseSMapRegions) {

0 commit comments

Comments
 (0)