[libcxx-commits] [PATCH] D86255: [libunwind] Factor out getInfoFromFdeCie. NFCI.

Saleem Abdulrasool via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 20 09:50:09 PDT 2020


compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libunwind/src/UnwindCursor.hpp:1493
+    _info.gp                = prolog.spExtraArgSize;
+                               // Some frameless functions need SP
+                               // altered when resuming in function.
----------------
Can you fix this please?  The comment shouldn't be columnized.


================
Comment at: libunwind/src/UnwindCursor.hpp:1499
+    _info.unwind_info_size  = (uint32_t)fdeInfo.fdeLength;
+    _info.extra             = (unw_word_t)dso_base;
+
----------------
Since you are moving things anyways, please convert these to C++ style casts.


================
Comment at: libunwind/src/UnwindCursor.hpp:1965
       // Double check this FDE is for a function that includes the pc.
-      if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) {
-        typename CFI_Parser<A>::PrologInfo prolog;
-        if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo,
-                                                pc, R::getArch(), &prolog)) {
-          // save off parsed FDE info
-          _info.start_ip         = fdeInfo.pcStart;
-          _info.end_ip           = fdeInfo.pcEnd;
-          _info.lsda             = fdeInfo.lsda;
-          _info.handler          = cieInfo.personality;
-          _info.gp               = prolog.spExtraArgSize;
-          _info.flags            = 0;
-          _info.format           = dwarfEncoding();
-          _info.unwind_info      = fdeInfo.fdeStart;
-          _info.unwind_info_size = (uint32_t)fdeInfo.fdeLength;
-          _info.extra            = 0;
-          return;
-        }
-      }
+      if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd) &&
+          getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0, false))
----------------
Would you mind splitting this into two conditions?

```
if ((fdInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd))
  if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0, false))
    return;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86255



More information about the libcxx-commits mailing list