bulbazord created this revision.
bulbazord added reviewers: clayborg, DavidSpickett, JDevlieghere.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

I'm not convinced that it makes sense for the paths to be ConstStrings. We're
going to be putting them into FileSpecs (which are backed by
ConstStrings, for now) but otherwise there's no need to store them as
ConstStrings upfront.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153827

Files:
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.h


Index: lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
===================================================================
--- lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
+++ lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
@@ -20,7 +20,6 @@
 #include <vector>
 
 #include "lldb/Target/PostMortemProcess.h"
-#include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Status.h"
 
 #include "Plugins/ObjectFile/ELF/ELFHeader.h"
@@ -117,7 +116,7 @@
     lldb::addr_t start;
     lldb::addr_t end;
     lldb::addr_t file_ofs;
-    lldb_private::ConstString path;
+    std::string path;
   };
 
   // For ProcessElfCore only
Index: lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -258,8 +258,8 @@
     if (!m_nt_file_entries.empty()) {
       ModuleSpec exe_module_spec;
       exe_module_spec.GetArchitecture() = arch;
-      exe_module_spec.GetFileSpec().SetFile(
-          m_nt_file_entries[0].path.GetCString(), FileSpec::Style::native);
+      exe_module_spec.GetFileSpec().SetFile(m_nt_file_entries[0].path,
+                                            FileSpec::Style::native);
       if (exe_module_spec.GetFileSpec()) {
         exe_module_sp = GetTarget().GetOrCreateModule(exe_module_spec, 
                                                       true /* notify */);
@@ -938,7 +938,7 @@
       for (uint64_t i = 0; i < count; ++i) {
         const char *path = note.data.GetCStr(&offset);
         if (path && path[0])
-          m_nt_file_entries[i].path.SetCString(path);
+          m_nt_file_entries[i].path.assign(path);
       }
       break;
     }


Index: lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
===================================================================
--- lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
+++ lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
@@ -20,7 +20,6 @@
 #include <vector>
 
 #include "lldb/Target/PostMortemProcess.h"
-#include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Status.h"
 
 #include "Plugins/ObjectFile/ELF/ELFHeader.h"
@@ -117,7 +116,7 @@
     lldb::addr_t start;
     lldb::addr_t end;
     lldb::addr_t file_ofs;
-    lldb_private::ConstString path;
+    std::string path;
   };
 
   // For ProcessElfCore only
Index: lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -258,8 +258,8 @@
     if (!m_nt_file_entries.empty()) {
       ModuleSpec exe_module_spec;
       exe_module_spec.GetArchitecture() = arch;
-      exe_module_spec.GetFileSpec().SetFile(
-          m_nt_file_entries[0].path.GetCString(), FileSpec::Style::native);
+      exe_module_spec.GetFileSpec().SetFile(m_nt_file_entries[0].path,
+                                            FileSpec::Style::native);
       if (exe_module_spec.GetFileSpec()) {
         exe_module_sp = GetTarget().GetOrCreateModule(exe_module_spec, 
                                                       true /* notify */);
@@ -938,7 +938,7 @@
       for (uint64_t i = 0; i < count; ++i) {
         const char *path = note.data.GetCStr(&offset);
         if (path && path[0])
-          m_nt_file_entries[i].path.SetCString(path);
+          m_nt_file_entries[i].path.assign(path);
       }
       break;
     }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] ... Alex Langford via Phabricator via lldb-commits

Reply via email to