diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 46bd9ca..bda54fb 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -335,6 +335,29 @@ GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtrac
     return 0;
 }
 
+// This function handles run length encoding. It operated on one packet at a time. The
+// size of the packet is passed in the 'size' parameter. The packet data is assumed to be
+// present in the 'm_bytes'. The decoded data is returned in rle_data parameter.
+// The run length encoding used here is described in the following link.
+// http://sourceware.org/gdb/onlinedocs/gdb/Overview.html
+void
+GDBRemoteCommunication::HandleRunLengthEncoding (size_t size, std::string& decoded_data)
+{
+    for (size_t i = 0; i < size; i++)
+    {
+        if(m_bytes[i] == '*')
+        {
+            // (i+1) gives the repeat count and (i-1) is the character to repeat.
+            size_t repeat = m_bytes[i + 1] - ' ' + 3;
+            if (repeat > 0 && repeat <= 255)
+                decoded_data.append(repeat, m_bytes[i - 1]);
+            i++;
+        }
+        else
+            decoded_data.append(1, m_bytes[i]);
+    }
+}
+
 bool
 GDBRemoteCommunication::CheckForPacket (const uint8_t *src, size_t src_len, StringExtractorGDBRemote &packet)
 {
@@ -384,6 +407,18 @@ GDBRemoteCommunication::CheckForPacket (const uint8_t *src, size_t src_len, Stri
                     {
                         if (hash_pos + 2 < m_bytes.size())
                         {
+                            size_t star_pos = m_bytes.find('*');
+                            if (star_pos != std::string::npos)
+                            {
+                                // The data in this packet is Run Length encoded so
+                                // we decode it now.
+                                std::string rle_data;
+                                HandleRunLengthEncoding (hash_pos, rle_data);
+                                // Replace original packet bytes by the decoded data. Also
+                                // update the hash_pos accordingly.
+                                m_bytes.replace(0, hash_pos, rle_data);
+                                hash_pos = rle_data.size();
+                            }
                             checksum_idx = hash_pos + 1;
                             // Skip the dollar sign
                             content_start = 1; 
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index a107795..bca3c5b 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -238,6 +238,9 @@ protected:
     bool
     WaitForNotRunningPrivate (const lldb_private::TimeValue *timeout_ptr);
 
+    void
+    HandleRunLengthEncoding (size_t size, std::string& decoded_data);
+
     //------------------------------------------------------------------
     // Classes that inherit from GDBRemoteCommunication can see and modify these
     //------------------------------------------------------------------
