[Lldb-commits] [PATCH] D100850: Fix reading from file cache using address instead of resolved address for getting a section

Augusto Noronha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 20 06:31:14 PDT 2021


augusto2112 created this revision.
augusto2112 added a reviewer: jasonmolenda.
augusto2112 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This fiex a small problem with https://reviews.llvm.org/D100338 where we'd grab the section from the address instead of resolved address, which could incur a memory read instead of a file cache read if the two addressess were different


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100850

Files:
  lldb/source/Target/Target.cpp


Index: lldb/source/Target/Target.cpp
===================================================================
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -1756,7 +1756,7 @@
   bool is_readonly = false;
   // Read from file cache if read-only section.
   if (!force_live_memory && resolved_addr.IsSectionOffset()) {
-    SectionSP section_sp(addr.GetSection());
+    SectionSP section_sp(resolved_addr.GetSection());
     if (section_sp) {
       auto permissions = Flags(section_sp->GetPermissions());
       is_readonly = !permissions.Test(ePermissionsWritable) &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100850.338847.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210420/3d2e1fff/attachment.bin>


More information about the lldb-commits mailing list