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) &&


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) &&
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to