[Lldb-commits] [PATCH] D89124: [lldb-server][linux] Add ability to allocate memory

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 9 08:37:13 PDT 2020


jankratochvil added inline comments.


================
Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1354
+  auto region_it = llvm::find_if(m_mem_region_cache, [](const auto &pair) {
+    return pair.first.GetExecutable() == MemoryRegionInfo::eYes;
+  });
----------------
Finding arbitrary address would not be safe if LLDB supports [[ https://lldb.llvm.org/status/projects.html#non-stop-debugging | non-stop mode if implemented ]]. It also makes the address a bit non-deterministic. IIRC GDB is using executable's e_entry (="_start" if it exists). But I do not have any strong reason for that.



================
Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1444
+    prot |= PROT_EXEC;
+
+  llvm::Expected<uint64_t> Result =
----------------
Some sanity check 'permissions' does not have set a bit which NativeProcessLinux::AllocateMemory does not understand?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89124/new/

https://reviews.llvm.org/D89124



More information about the lldb-commits mailing list