Skip to content

[GDBRemote] Handle 'heap' memory region info type #105883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,8 @@ Status GDBRemoteCommunicationClient::GetMemoryRegionInfo(
for (llvm::StringRef entry : llvm::split(value, ',')) {
if (entry == "stack")
region_info.SetIsStackMemory(MemoryRegionInfo::eYes);
else if (entry == "heap")
region_info.SetIsStackMemory(MemoryRegionInfo::eNo);
}
} else if (name == "error") {
StringExtractorGDBRemote error_extractor(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfo) {
EXPECT_TRUE(result.get().Success());
EXPECT_EQ(MemoryRegionInfo::eYes, 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;type:heap;");
EXPECT_TRUE(result.get().Success());
EXPECT_EQ(MemoryRegionInfo::eNo, region_info.IsStackMemory());
}

TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfoInvalidResponse) {
Expand Down
Loading