[Lldb-commits] [PATCH] D87868: [RFC] When calling the process mmap try to call all found instead of just the first one

António Afonso via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 5 10:24:14 PDT 2020


aadsm updated this revision to Diff 296220.
aadsm added a comment.

I explored Greg's suggestion of checking if the functions were external symbols. As suspected the overriden mmap is not external, so we can use this check to avoid calling it!

It does look to me that Pavel's suggestion is the way to go in the future but I don't have the knowledge to implement the suggestion nor (unfortunately) the bandwidth to gain that knowledge right. In the meanwhile I was hoping we could go with this new version of the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87868

Files:
  lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp


Index: lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
===================================================================
--- lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+++ lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
@@ -48,9 +48,10 @@
       ConstString("mmap"), eFunctionNameTypeFull, include_symbols,
       include_inlines, sc_list);
   const uint32_t count = sc_list.GetSize();
-  if (count > 0) {
+  for (uint32_t i = 0; i < count; i++) {
     SymbolContext sc;
-    if (sc_list.GetContextAtIndex(0, sc)) {
+    if (sc_list.GetContextAtIndex(i, sc) &&
+        (sc.symbol->IsExternal() || sc.symbol->IsWeak())) {
       const uint32_t range_scope =
           eSymbolContextFunction | eSymbolContextSymbol;
       const bool use_inline_block_range = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87868.296220.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201005/dec8955a/attachment-0001.bin>


More information about the lldb-commits mailing list