[lldb] Remove remaining calls to DataBufferLLVM::GetChars
authorJonas Devlieghere <jonas@devlieghere.com>
Sat, 2 Apr 2022 00:41:36 +0000 (17:41 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Sat, 2 Apr 2022 00:43:05 +0000 (17:43 -0700)
Update the Linux and NetBSD Host libraries for 2165c36be445 which
removed DataBufferLLVM::GetChars. These files are compiled conditionally
based on the host platform.

lldb/source/Host/linux/Host.cpp
lldb/source/Host/netbsd/HostNetBSD.cpp

index 26f5233..6342dee 100644 (file)
@@ -133,10 +133,10 @@ static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) {
   if (!buffer_sp)
     return ArchSpec();
 
-  uint8_t exe_class =
-      llvm::object::getElfArchType(
-          {buffer_sp->GetChars(), size_t(buffer_sp->GetByteSize())})
-          .first;
+  uint8_t exe_class = llvm::object::getElfArchType(
+                          {reinterpret_cast<char *>(buffer_sp->GetBytes()),
+                           size_t(buffer_sp->GetByteSize())})
+                          .first;
 
   switch (exe_class) {
   case llvm::ELF::ELFCLASS32:
index 60e7241..9168ed9 100644 (file)
@@ -108,10 +108,10 @@ static bool GetNetBSDProcessCPUType(ProcessInstanceInfo &process_info) {
     auto buffer_sp = FileSystem::Instance().CreateDataBuffer(
         process_info.GetExecutableFile(), 0x20, 0);
     if (buffer_sp) {
-      uint8_t exe_class =
-          llvm::object::getElfArchType(
-              {buffer_sp->GetChars(), size_t(buffer_sp->GetByteSize())})
-              .first;
+      uint8_t exe_class = llvm::object::getElfArchType(
+                              {reinterpret_cast<char *>(buffer_sp->GetBytes()),
+                               size_t(buffer_sp->GetByteSize())})
+                              .first;
 
       switch (exe_class) {
       case llvm::ELF::ELFCLASS32: