aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2024-08-23 13:09:31 -0700
committerGitHub <noreply@github.com>2024-08-23 13:09:31 -0700
commit8b4147d14c460f8886e882db48361d4c101917d7 (patch)
treeec1c185e806e9e32c7a07b47a1d3e83e13fc8341 /lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
parentaa61925eace86602ce1da00bda4a993719061df2 (diff)
downloadllvm-8b4147d14c460f8886e882db48361d4c101917d7.zip
llvm-8b4147d14c460f8886e882db48361d4c101917d7.tar.gz
llvm-8b4147d14c460f8886e882db48361d4c101917d7.tar.bz2
[GDBRemote] Fix processing of comma-separated memory region entries (#105873)
The existing algorithm was performing the following comparisons for an `aaa,bbb,ccc,ddd`: aaa\0bbb,ccc,ddd == "stack" aaa\0bbb\0ccc,ddd == "stack" aaa\0bbb\0ccc\0ddd == "stack" Which wouldn't work. This commit just dispatches to a known algorithm implementation.
Diffstat (limited to 'lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 11e14f9..18020c8e 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -343,24 +343,27 @@ TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfo) {
EXPECT_EQ(MemoryRegionInfo::eYes, region_info.GetExecutable());
EXPECT_EQ("/foo/bar.so", region_info.GetName().GetStringRef());
EXPECT_EQ(MemoryRegionInfo::eDontKnow, region_info.GetMemoryTagged());
+ EXPECT_EQ(MemoryRegionInfo::eDontKnow, region_info.IsStackMemory());
result = std::async(std::launch::async, [&] {
return client.GetMemoryRegionInfo(addr, region_info);
});
HandlePacket(server, "qMemoryRegionInfo:a000",
- "start:a000;size:2000;flags:;");
+ "start:a000;size:2000;flags:;type:stack;");
EXPECT_TRUE(result.get().Success());
EXPECT_EQ(MemoryRegionInfo::eNo, region_info.GetMemoryTagged());
+ EXPECT_EQ(MemoryRegionInfo::eYes, region_info.IsStackMemory());
result = std::async(std::launch::async, [&] {
return client.GetMemoryRegionInfo(addr, region_info);
});
HandlePacket(server, "qMemoryRegionInfo:a000",
- "start:a000;size:2000;flags: mt zz mt ;");
+ "start:a000;size:2000;flags: mt zz mt ;type:ha,ha,stack;");
EXPECT_TRUE(result.get().Success());
EXPECT_EQ(MemoryRegionInfo::eYes, region_info.GetMemoryTagged());
+ EXPECT_EQ(MemoryRegionInfo::eYes, region_info.IsStackMemory());
}
TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfoInvalidResponse) {