summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Process/gdb-remote
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-30 13:56:11 +0000
committerPavel Labath <labath@google.com>2016-08-30 13:56:11 +0000
commit5c95ee4dd87f34b4564e6eada2e8e4b70834db68 (patch)
tree863645a416ed01b5f4f07962a535d3ad172ce13d /lldb/unittests/Process/gdb-remote
parentfdc628f7219f6974c1693e0d40fbdae79ea3a282 (diff)
downloadbcm5719-llvm-5c95ee4dd87f34b4564e6eada2e8e4b70834db68.tar.gz
bcm5719-llvm-5c95ee4dd87f34b4564e6eada2e8e4b70834db68.zip
Revert "gdb-remote: Make the sequence mutex non-recursive"
This reverts commit r279725 as it breaks "dynamic register size" feature of mips. llvm-svn: 280088
Diffstat (limited to 'lldb/unittests/Process/gdb-remote')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp42
1 files changed, 11 insertions, 31 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 95bd5cd5be0..0b1f60d33d0 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -76,22 +76,17 @@ TEST_F(GDBRemoteCommunicationClientTest, WriteRegister)
if (HasFailure())
return;
- std::future<void> suffix_result = std::async(std::launch::async, [&] { client.ComputeThreadSuffixSupport(); });
- Handle_QThreadSuffixSupported(server, true);
- suffix_result.get();
-
- GDBRemoteCommunicationClient::Lock lock(client, false);
- ASSERT_TRUE(bool(lock));
-
const lldb::tid_t tid = 0x47;
const uint32_t reg_num = 4;
std::future<bool> write_result =
- std::async(std::launch::async, [&] { return client.WriteRegister(tid, reg_num, one_register, lock); });
+ std::async(std::launch::async, [&] { return client.WriteRegister(tid, reg_num, one_register); });
+
+ Handle_QThreadSuffixSupported(server, true);
HandlePacket(server, "P4=" + one_register_hex + ";thread:0047;", "OK");
ASSERT_TRUE(write_result.get());
- write_result = std::async(std::launch::async, [&] { return client.WriteAllRegisters(tid, all_registers, lock); });
+ write_result = std::async(std::launch::async, [&] { return client.WriteAllRegisters(tid, all_registers); });
HandlePacket(server, "G" + all_registers_hex + ";thread:0047;", "OK");
ASSERT_TRUE(write_result.get());
@@ -105,23 +100,17 @@ TEST_F(GDBRemoteCommunicationClientTest, WriteRegisterNoSuffix)
if (HasFailure())
return;
- std::future<void> suffix_result = std::async(std::launch::async, [&] { client.ComputeThreadSuffixSupport(); });
- Handle_QThreadSuffixSupported(server, false);
- suffix_result.get();
-
- GDBRemoteCommunicationClient::Lock lock(client, false);
- ASSERT_TRUE(bool(lock));
-
const lldb::tid_t tid = 0x47;
const uint32_t reg_num = 4;
std::future<bool> write_result =
- std::async(std::launch::async, [&] { return client.WriteRegister(tid, reg_num, one_register, lock); });
+ std::async(std::launch::async, [&] { return client.WriteRegister(tid, reg_num, one_register); });
+ Handle_QThreadSuffixSupported(server, false);
HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "P4=" + one_register_hex, "OK");
ASSERT_TRUE(write_result.get());
- write_result = std::async(std::launch::async, [&] { return client.WriteAllRegisters(tid, all_registers, lock); });
+ write_result = std::async(std::launch::async, [&] { return client.WriteAllRegisters(tid, all_registers); });
HandlePacket(server, "G" + all_registers_hex, "OK");
ASSERT_TRUE(write_result.get());
@@ -135,27 +124,21 @@ TEST_F(GDBRemoteCommunicationClientTest, ReadRegister)
if (HasFailure())
return;
- std::future<void> suffix_result = std::async(std::launch::async, [&] { client.ComputeThreadSuffixSupport(); });
- Handle_QThreadSuffixSupported(server, true);
- suffix_result.get();
-
const lldb::tid_t tid = 0x47;
const uint32_t reg_num = 4;
std::future<bool> async_result = std::async(std::launch::async, [&] { return client.GetpPacketSupported(tid); });
+ Handle_QThreadSuffixSupported(server, true);
HandlePacket(server, "p0;thread:0047;", one_register_hex);
ASSERT_TRUE(async_result.get());
- GDBRemoteCommunicationClient::Lock lock(client, false);
- ASSERT_TRUE(bool(lock));
-
std::future<DataBufferSP> read_result =
- std::async(std::launch::async, [&] { return client.ReadRegister(tid, reg_num, lock); });
+ std::async(std::launch::async, [&] { return client.ReadRegister(tid, reg_num); });
HandlePacket(server, "p4;thread:0047;", "41424344");
auto buffer_sp = read_result.get();
ASSERT_TRUE(bool(buffer_sp));
ASSERT_EQ(0, memcmp(buffer_sp->GetBytes(), one_register, sizeof one_register));
- read_result = std::async(std::launch::async, [&] { return client.ReadAllRegisters(tid, lock); });
+ read_result = std::async(std::launch::async, [&] { return client.ReadAllRegisters(tid); });
HandlePacket(server, "g;thread:0047;", all_registers_hex);
buffer_sp = read_result.get();
ASSERT_TRUE(bool(buffer_sp));
@@ -170,14 +153,11 @@ TEST_F(GDBRemoteCommunicationClientTest, SaveRestoreRegistersNoSuffix)
if (HasFailure())
return;
- std::future<void> suffix_result = std::async(std::launch::async, [&] { client.ComputeThreadSuffixSupport(); });
- Handle_QThreadSuffixSupported(server, false);
- suffix_result.get();
-
const lldb::tid_t tid = 0x47;
uint32_t save_id;
std::future<bool> async_result =
std::async(std::launch::async, [&] { return client.SaveRegisterState(tid, save_id); });
+ Handle_QThreadSuffixSupported(server, false);
HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "QSaveRegisterState", "1");
ASSERT_TRUE(async_result.get());
OpenPOWER on IntegriCloud