Logging and return code fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136530 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index eb0f6d2..39624dc 100644
--- a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -753,7 +753,7 @@
                         {
                             const uint32_t error = packet.GetU32 (&offset);
                             const uint32_t count = packet.GetByteSize() - offset;
-                            s.Printf(" (error = 0x%8.8x <0x%x>:\n", error, count); 
+                            s.Printf(" (error = 0x%8.8x:\n", error); 
                             if (count > 0)
                                 packet.Dump (&s,                        // Stream to dump to
                                              offset,                    // Offset within "packet"
@@ -770,7 +770,7 @@
                         {
                             const uint32_t error = packet.GetU32 (&offset);
                             const uint32_t count = packet.GetByteSize() - offset;
-                            s.Printf(" (error = 0x%8.8x <0x%x> regs:\n", error, count); 
+                            s.Printf(" (error = 0x%8.8x regs:\n", error); 
                             if (count > 0)
                                 packet.Dump (&s,                        // Stream to dump to
                                              offset,                    // Offset within "packet"
@@ -817,7 +817,7 @@
                         {
                             const uint16_t reply_port = packet.GetU16 (&offset);
                             const uint16_t exc_port = packet.GetU16 (&offset);
-                            s.Printf(" (reply_port=%u, exc_port=%u, greeting=\"%s\")", reply_port, exc_port, packet.GetCStr(&offset));
+                            s.Printf(" (reply_port = %u, exc_port = %u, greeting = \"%s\")", reply_port, exc_port, packet.GetCStr(&offset));
                         }
                         break;
                                  
@@ -845,7 +845,7 @@
                         {
                             const uint32_t addr = packet.GetU32 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%8.8x, size=%u)", addr, size);
+                            s.Printf(" (addr = 0x%8.8x, size = %u)", addr, size);
                             m_last_read_memory_addr = addr;
                         }
                         break;
@@ -854,7 +854,7 @@
                         {
                             const uint32_t addr = packet.GetU32 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%8.8x, size=%u, bytes:\n", addr, size);
+                            s.Printf(" (addr = 0x%8.8x, size = %u, bytes = \n", addr, size);
                             if (size > 0)
                                 DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
                         }
@@ -864,7 +864,7 @@
                         {
                             const uint64_t addr = packet.GetU64 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%16.16llx, size=%u)", addr, size);
+                            s.Printf(" (addr = 0x%16.16llx, size = %u)", addr, size);
                             m_last_read_memory_addr = addr;
                         }
                         break;
@@ -873,7 +873,7 @@
                         {
                             const uint64_t addr = packet.GetU64 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%16.16llx, size=%u, bytes:", addr, size);
+                            s.Printf(" (addr = 0x%16.16llx, size = %u, bytes = \n", addr, size);
                             if (size > 0)
                                 DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
                         }
@@ -883,7 +883,7 @@
                         {
                             const uint32_t cpu = packet.GetU32 (&offset);
                             const uint32_t flavor = packet.GetU32 (&offset);
-                            s.Printf(" (cpu = %u, flavor=%u)", cpu, flavor);
+                            s.Printf(" (cpu = %u, flavor = %u)", cpu, flavor);
                         }
                         break;
 
@@ -892,7 +892,7 @@
                             const uint32_t cpu = packet.GetU32 (&offset);
                             const uint32_t flavor = packet.GetU32 (&offset);
                             const uint32_t nbytes = packet.GetByteSize() - offset;
-                            s.Printf(" (cpu = %u, flavor=%u, regs:\n", cpu, flavor);
+                            s.Printf(" (cpu = %u, flavor = %u, regs = \n", cpu, flavor);
                             if (nbytes > 0)
                                 packet.Dump (&s,                        // Stream to dump to
                                              offset,                    // Offset within "packet"
@@ -975,7 +975,7 @@
                     case KDP_REATTACH:
                         {
                             const uint16_t reply_port = packet.GetU16 (&offset);
-                            s.Printf(" (reply_port=%u)", reply_port);
+                            s.Printf(" (reply_port = %u)", reply_port);
                         }
                         break;
                 }
@@ -1080,7 +1080,12 @@
     
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
-        return true;
+    {
+        uint32_t offset = 8;
+        uint32_t kdp_error = reply_packet.GetU32 (&offset);        
+        if (kdp_error == 0)
+            return true;
+    }
     return false;
 }