[Lldb-commits] [PATCH] D62796: [Target] Generalize some behavior in Target::SymbolsDidLoad

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 3 10:09:27 PDT 2019


xiaobai marked 2 inline comments as done.
xiaobai added inline comments.


================
Comment at: source/Target/Target.cpp:1670
     if (m_process_sp) {
-      LanguageRuntime *runtime =
-          m_process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);
-      if (runtime) {
-        ObjCLanguageRuntime *objc_runtime = (ObjCLanguageRuntime *)runtime;
+      if (LanguageRuntime *objc_runtime =
+              m_process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC))
----------------
xiaobai wrote:
> clayborg wrote:
> > labath wrote:
> > > Same question about runtime iteration as in the other review.
> > Seems like we should add a Process::SymbolsDidLoad() method that matches this method's signature and just call that. Process would iterate across all loaded language runtimes and call SymbolsDidLoad on any?
> Right, we should definitely iterate over loaded language runtimes instead of just using the ObjC runtime. Will update.
Instead of adding `Process::SymbolsDidLoad`, I could instead iterate here over the loaded language runtimes with `Process::GetLanguageRuntimes` and call `LanguageRuntime::SymbolsDidLoad` on each one. What do you think? This would prevent us from having 3 classes with the method `SymbolsDidLoad` with the same signature.


================
Comment at: source/Target/Target.cpp:1670-1672
+      if (LanguageRuntime *objc_runtime =
+              m_process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC))
         objc_runtime->SymbolsDidLoad(module_list);
----------------
clayborg wrote:
> labath wrote:
> > Same question about runtime iteration as in the other review.
> Seems like we should add a Process::SymbolsDidLoad() method that matches this method's signature and just call that. Process would iterate across all loaded language runtimes and call SymbolsDidLoad on any?
Right, we should definitely iterate over loaded language runtimes instead of just using the ObjC runtime. Will update.


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

https://reviews.llvm.org/D62796





More information about the lldb-commits mailing list