[Lldb-commits] [lldb] 33d7417 - [LLDB] Modifying expression code in MakeLoadImageUtilityFunction to be more consistent

Shafik Yaghmour via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 17 08:53:04 PDT 2022


Author: Shafik Yaghmour
Date: 2022-03-17T08:52:56-07:00
New Revision: 33d74170a36e3b801e93152effa59f19d9abb3a0

URL: https://github.com/llvm/llvm-project/commit/33d74170a36e3b801e93152effa59f19d9abb3a0
DIFF: https://github.com/llvm/llvm-project/commit/33d74170a36e3b801e93152effa59f19d9abb3a0.diff

LOG: [LLDB] Modifying expression code in MakeLoadImageUtilityFunction to be more consistent

MakeLoadImageUtilityFunction() is not using extern "C" for external C functions
and it is not using eLanguageTypeC_plus_plus. So I am modifying it to be consistent.

Also see: rdar://87544782

Differential Revision: https://reviews.llvm.org/D121831

Added: 
    

Modified: 
    lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index a25fd1f2678eb..42de703e8ed07 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -560,8 +560,8 @@ PlatformPOSIX::MakeLoadImageUtilityFunction(ExecutionContext &exe_ctx,
     const char *error_str;
   };
   
-  extern void *memcpy(void *, const void *, size_t size);
-  extern size_t strlen(const char *);
+  extern "C" void *memcpy(void *, const void *, size_t size);
+  extern "C" size_t strlen(const char *);
   
 
   void * __lldb_dlopen_wrapper (const char *name, 
@@ -608,7 +608,7 @@ PlatformPOSIX::MakeLoadImageUtilityFunction(ExecutionContext &exe_ctx,
   DiagnosticManager diagnostics;
 
   auto utility_fn_or_error = process->GetTarget().CreateUtilityFunction(
-      std::move(expr), dlopen_wrapper_name, eLanguageTypeObjC, exe_ctx);
+      std::move(expr), dlopen_wrapper_name, eLanguageTypeC_plus_plus, exe_ctx);
   if (!utility_fn_or_error) {
     std::string error_str = llvm::toString(utility_fn_or_error.takeError());
     error.SetErrorStringWithFormat("dlopen error: could not create utility"


        


More information about the lldb-commits mailing list