[Lldb-commits] [PATCH] D71487: [LLDB] Fix address computation for inline function

Johannes Altmanninger via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 19 15:20:36 PST 2019


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





More information about the lldb-commits mailing list