diff options
author | Greg Clayton <gclayton@apple.com> | 2011-07-07 01:59:51 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-07-07 01:59:51 +0000 |
commit | 644247c1dc56106a06afbf8ac25fa4e07f46dd88 (patch) | |
tree | f318a596a16b71724e40d6ae52564b263b5baa10 /lldb/source/Plugins/Process | |
parent | a3c122db7e4883129bb35558becd6fe8c4722295 (diff) | |
download | bcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.tar.gz bcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.zip |
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.
llvm-svn: 134579
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 29 |
2 files changed, 33 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 69f97f14add..c13328cd50f 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -190,6 +190,8 @@ GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtrac uint8_t buffer[8192]; Error error; + LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS | GDBR_LOG_VERBOSE)); + // Check for a packet from our cache first without trying any reading... if (CheckForPacket (NULL, 0, packet)) return packet.GetStringRef().size(); @@ -199,6 +201,15 @@ GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtrac { lldb::ConnectionStatus status; size_t bytes_read = Read (buffer, sizeof(buffer), timeout_usec, status, &error); + + if (log) + log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %zu", + __PRETTY_FUNCTION__, + timeout_usec, + Communication::ConnectionStatusAsCString (status), + error.AsCString(), + bytes_read); + if (bytes_read > 0) { if (CheckForPacket (buffer, bytes_read, packet)) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index afe376a5f58..e9cd2f86424 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -237,11 +237,16 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse { 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 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse 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 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse 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 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse 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> |