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;


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

Reply via email to