[Lldb-commits] [PATCH] D146154: [lldb][gnustep] Add minimal GNUstepObjCRuntime plugin for LanguageTypeObjC on non-Apple platforms

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 21 08:36:06 PDT 2023


sgraenitz added a comment.

In D146154#4203277 <https://reviews.llvm.org/D146154#4203277>, @aprantl wrote:

> Here is an example of how the Swift Runtime plugin detects both itself and whether ObjC interop is enabled. Basically all I'm asking is to not accidentally break this mechanism.

Thanks for the link! I think Swift is doing the exact right thing here: it requests the Apple ObjC V2 runtime explicitly in https://github.com/apple/llvm-project/blob/fcf8f57c74defcc0c422331cb90a3b9dd8d7b476/lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp#L102-L106

Anyway, I updated my patch to do the symbol lookup, because the pure presence of an ObjC runtime makes for some interesting regressions in the test suite. E.g. here we enable ObjC in C++ code <https://github.com/llvm/llvm-project/blob/release/16.x/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp#L554-L555> if the runtime exists:

  lang_opts.ObjC =
      process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC) != nullptr;



================
Comment at: lldb/source/Plugins/LanguageRuntime/ObjC/GNUstepObjCRuntime/GNUstepObjCRuntime.cpp:62
+    images.FindSymbolsWithNameAndType(ConstString("__objc_load"),
+                                      eSymbolTypeCode, objc_mandatory);
+    if (objc_mandatory.GetSize() == 0)
----------------
There is no EH personality on Windows so I am checking for a core ObjC runtime symbol. Hope that's ok?
I put a list with all DLL symbols here: https://gist.github.com/weliveindetail/0c57135741b314d2952236bcffae0ab1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146154



More information about the lldb-commits mailing list