[PATCH] D42145: [lldb] Use vFlash commands when writing to target's flash memory regions

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 03:11:50 PST 2018


labath added inline comments.


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:3500-3518
+  // Create a list of write entries from loadable segments,
+  // using physical addresses if they aren't all null
+  size_t header_count = ParseProgramHeaders();
+  bool should_use_paddr = AnySegmentHasPhysicalAddress();
+  for (size_t i = 1; i <= header_count; ++i) {
+    Process::WriteEntry entry;
+    auto header = GetProgramHeaderByIndex(i);
----------------
This is the only part that's ELF-specific. Could we factor this out into a separate function (and leave the common part in ObjectFile)? Besides reducing duplication this will also make it easier to remove the Target/Process/RegisterContext uses from the ObjectFile in the future, as there will be just a single place that needs to be updated.


https://reviews.llvm.org/D42145





More information about the llvm-commits mailing list