[Lldb-commits] [lldb] r296930 - Fix DataExtractor failures.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 3 15:52:09 PST 2017


Author: zturner
Date: Fri Mar  3 17:52:09 2017
New Revision: 296930

URL: http://llvm.org/viewvc/llvm-project?rev=296930&view=rev
Log:
Fix DataExtractor failures.

Some code that doesn't get compiled on Windows had some references
that needed updating, and I missed those.

Modified:
    lldb/trunk/include/lldb/Core/DumpDataExtractor.h
    lldb/trunk/source/Core/DumpDataExtractor.cpp
    lldb/trunk/source/Expression/Materializer.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp

Modified: lldb/trunk/include/lldb/Core/DumpDataExtractor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DumpDataExtractor.h?rev=296930&r1=296929&r2=296930&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/DumpDataExtractor.h (original)
+++ lldb/trunk/include/lldb/Core/DumpDataExtractor.h Fri Mar  3 17:52:09 2017
@@ -83,6 +83,9 @@ DumpDataExtractor(const DataExtractor &D
                   size_t item_count, size_t num_per_line, uint64_t base_addr,
                   uint32_t item_bit_size, uint32_t item_bit_offset,
                   ExecutionContextScope *exe_scope = nullptr);
+
+void DumpHexBytes(Stream *s, const void *src, size_t src_len,
+                  uint32_t bytes_per_line, lldb::addr_t base_addr);
 }
 
 #endif

Modified: lldb/trunk/source/Core/DumpDataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DumpDataExtractor.cpp?rev=296930&r1=296929&r2=296930&view=diff
==============================================================================
--- lldb/trunk/source/Core/DumpDataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DumpDataExtractor.cpp Fri Mar  3 17:52:09 2017
@@ -786,3 +786,17 @@ lldb::offset_t lldb_private::DumpDataExt
   }
   return offset; // Return the offset at which we ended up
 }
+
+void lldb_private::DumpHexBytes(Stream *s, const void *src, size_t src_len,
+                                uint32_t bytes_per_line,
+                                lldb::addr_t base_addr) {
+  DataExtractor data(src, src_len, lldb::eByteOrderLittle, 4);
+  DumpDataExtractor(data, s,
+                    0,                  // Offset into "src"
+                    lldb::eFormatBytes, // Dump as hex bytes
+                    1,              // Size of each item is 1 for single bytes
+                    src_len,        // Number of bytes
+                    bytes_per_line, // Num bytes per line
+                    base_addr,      // Base address
+                    0, 0);          // Bitfield info
+}

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=296930&r1=296929&r2=296930&view=diff
==============================================================================
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Fri Mar  3 17:52:09 2017
@@ -30,19 +30,6 @@
 
 using namespace lldb_private;
 
-static void DumpHexBytes(Stream *s, const void *src, size_t src_len,
-                         uint32_t bytes_per_line, lldb::addr_t base_addr) {
-  DataExtractor data(src, src_len, lldb::eByteOrderLittle, 4);
-  DumpDataExtractor(data, s,
-                    0,                  // Offset into "src"
-                    lldb::eFormatBytes, // Dump as hex bytes
-                    1,              // Size of each item is 1 for single bytes
-                    src_len,        // Number of bytes
-                    bytes_per_line, // Num bytes per line
-                    base_addr,      // Base address
-                    0, 0);          // Bitfield info
-}
-
 uint32_t Materializer::AddStructMember(Entity &entity) {
   uint32_t size = entity.GetSize();
   uint32_t alignment = entity.GetAlignment();

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=296930&r1=296929&r2=296930&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Fri Mar  3 17:52:09 2017
@@ -19,6 +19,7 @@
 // Other libraries and framework includes
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/DataExtractor.h"
+#include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/State.h"
 #include "lldb/Core/UUID.h"
 #include "lldb/Host/FileSpec.h"
@@ -259,8 +260,7 @@ bool CommunicationKDP::CheckForPacket(co
   if (src && src_len > 0) {
     if (log && log->GetVerbose()) {
       PacketStreamType log_strm;
-      DataExtractor::DumpHexBytes(&log_strm, src, src_len, UINT32_MAX,
-                                  LLDB_INVALID_ADDRESS);
+      DumpHexBytes(&log_strm, src, src_len, UINT32_MAX, LLDB_INVALID_ADDRESS);
       log->Printf("CommunicationKDP::%s adding %u bytes: %s", __FUNCTION__,
                   (uint32_t)src_len, log_strm.GetData());
     }
@@ -976,8 +976,7 @@ void CommunicationKDP::DumpPacket(Stream
           const uint32_t size = packet.GetU32(&offset);
           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);
+            DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
         } break;
 
         case KDP_READMEM64: {
@@ -1002,8 +1001,7 @@ void CommunicationKDP::DumpPacket(Stream
           s.Printf(" (addr = 0x%16.16" PRIx64 ", size = %u, bytes = \n", addr,
                    size);
           if (size > 0)
-            DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size,
-                                        32, addr);
+            DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
         } break;
 
         case KDP_WRITEPHYSMEM64: {
@@ -1013,8 +1011,7 @@ void CommunicationKDP::DumpPacket(Stream
           s.Printf(" (addr = 0x%16.16llx, size = %u, lcpu = %u, bytes = \n",
                    addr, size, lcpu);
           if (size > 0)
-            DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size,
-                                        32, addr);
+            DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
         } break;
 
         case KDP_READREGS: {




More information about the lldb-commits mailing list