Skip to content
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 @@ -211,6 +211,12 @@ bool GDBRemoteCommunicationClient::GetReverseStepSupported() {
return m_supports_reverse_step == eLazyBoolYes;
}

bool GDBRemoteCommunicationClient::GetMultiMemReadSupported() {
if (m_supports_multi_mem_read == eLazyBoolCalculate)
GetRemoteQSupported();
return m_supports_multi_mem_read == eLazyBoolYes;
}

bool GDBRemoteCommunicationClient::QueryNoAckModeSupported() {
if (m_supports_not_sending_acks == eLazyBoolCalculate) {
m_send_acks = true;
Expand Down Expand Up @@ -339,6 +345,7 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
m_supported_async_json_packets_is_valid = false;
m_supported_async_json_packets_sp.reset();
m_supports_jModulesInfo = true;
m_supports_multi_mem_read = eLazyBoolCalculate;
}

// These flags should be reset when we first connect to a GDB server and when
Expand All @@ -365,6 +372,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_x_packet_state.reset();
m_supports_reverse_continue = eLazyBoolNo;
m_supports_reverse_step = eLazyBoolNo;
m_supports_multi_mem_read = eLazyBoolNo;

m_max_packet_size = UINT64_MAX; // It's supposed to always be there, but if
// not, we assume no limit
Expand Down Expand Up @@ -424,6 +432,8 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_reverse_continue = eLazyBoolYes;
else if (x == "ReverseStep+")
m_supports_reverse_step = eLazyBoolYes;
else if (x == "MultiMemRead+")
m_supports_multi_mem_read = eLazyBoolYes;
// Look for a list of compressions in the features list e.g.
// qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-
// deflate,lzma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase {

bool GetReverseStepSupported();

bool GetMultiMemReadSupported();

LazyBool SupportsAllocDeallocMemory() // const
{
// Uncomment this to have lldb pretend the debug server doesn't respond to
Expand Down Expand Up @@ -574,6 +576,7 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase {
std::optional<xPacketState> m_x_packet_state;
LazyBool m_supports_reverse_continue = eLazyBoolCalculate;
LazyBool m_supports_reverse_step = eLazyBoolCalculate;
LazyBool m_supports_multi_mem_read = eLazyBoolCalculate;

bool m_supports_qProcessInfoPID : 1, m_supports_qfProcessInfo : 1,
m_supports_qUserName : 1, m_supports_qGroupName : 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,3 +639,25 @@ TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
EXPECT_EQ(expected_high, result->high());
}
#endif

TEST_F(GDBRemoteCommunicationClientTest, MultiMemReadSupported) {
std::future<bool> async_result = std::async(std::launch::async, [&] {
StringExtractorGDBRemote qSupported_packet_request;
server.GetPacket(qSupported_packet_request);
server.SendPacket("MultiMemRead+;");
return true;
});
ASSERT_TRUE(client.GetMultiMemReadSupported());
async_result.wait();
}

TEST_F(GDBRemoteCommunicationClientTest, MultiMemReadNotSupported) {
std::future<bool> async_result = std::async(std::launch::async, [&] {
StringExtractorGDBRemote qSupported_packet_request;
server.GetPacket(qSupported_packet_request);
server.SendPacket(";");
return true;
});
ASSERT_FALSE(client.GetMultiMemReadSupported());
async_result.wait();
}
Loading