Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.
Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.
Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...).
Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.
Removed all of the unused proxy object support that bit rotted in
lldb_private::Value.
Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".
Improved logging in GDB remote plug-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134579 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index afe376a..e9cd2f8 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -237,11 +237,16 @@
{
Mutex::Locker locker;
LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
-
+ size_t response_len = 0;
if (GetSequenceMutex (locker))
{
if (SendPacketNoLock (payload, payload_length))
- return WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
+ response_len = WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
+ else
+ {
+ if (log)
+ log->Printf("error: failed to send '%*s'", payload_length, payload);
+ }
}
else
{
@@ -266,12 +271,15 @@
if (log)
log->Printf ("async: sent interrupt");
+
if (m_async_packet_predicate.WaitForValueEqualTo (false, &timeout_time, &timed_out))
{
if (log)
log->Printf ("async: got response");
- response = m_async_response;
- return response.GetStringRef().size();
+
+ // Swap the response buffer to avoid malloc and string copy
+ response.GetStringRef().swap (m_async_response.GetStringRef());
+ response_len = response.GetStringRef().size();
}
else
{
@@ -289,7 +297,9 @@
else
{
// We had a racy condition where we went to send the interrupt
- // yet we were able to get the loc
+ // yet we were able to get the lock
+ if (log)
+ log->Printf ("async: got lock but failed to send interrupt");
}
}
else
@@ -301,10 +311,15 @@
else
{
if (log)
- log->Printf ("mutex taken and send_async == false, aborting packet");
+ log->Printf("error: packet mutex taken and send_async == false, not sending packet '%*s'", payload_length, payload);
}
}
- return 0;
+ if (response_len == 0)
+ {
+ if (log)
+ log->Printf("error: failed to get response for '%*s'", payload_length, payload);
+ }
+ return response_len;
}
//template<typename _Tp>