One more fix to ProcessGDBRemote::DoDestroy(). This one will make sure we
parse the exit status in case we send this packet while stopped.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124177 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index b601d2c..263c5d8 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1307,7 +1307,17 @@
     {
         StringExtractorGDBRemote response;
         bool send_async = true;
-        if (m_gdb_comm.SendPacketAndWaitForResponse("k", 1, response, 3, send_async) == 0)
+        if (m_gdb_comm.SendPacketAndWaitForResponse("k", 1, response, 3, send_async))
+        {
+            char packet_cmd = response.GetChar(0);
+
+            if (packet_cmd == 'W' || packet_cmd == 'X')
+            {
+                m_last_stop_packet = response;
+                SetExitStatus(response.GetHexU8(), NULL);
+            }
+        }
+        else
         {
             error.SetErrorString("kill packet failed");
         }