johannes marked an inline comment as done.
johannes added inline comments.

================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2285
 
-    if (addr.IsValid()) {
+    if (addr.IsSectionOffset()) {
       sc_list.Append(sc);
----------------
clayborg wrote:
> Checking if the address is section offset might not be enough. All darwin 
> systems have a __PAGEZERO segment that covers the first 4GB for 64 bit files 
> and the first 4096 bytes for 32 bit fiules. This section has no read, no 
> write no execute permissions. So maybe grab the section and verify it has 
> read + execute permissions? That way data symbol matches won't trigger. 
> 
> ```
> if (auto section_sp = addr.GetSection()) {
>   if (section_sp->GetPermissions() & ePermissionsExecutable) {
>     sc_list.Append(sc);
>     return true;
>   }
> }
> ```
Yep, that works nicely!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71487



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to