<div dir="ltr">oh, awesome.<br><br>Were you using type units? (I imagine that'd make the situation worse - since the way clang emits DWARF for a type with a member function template implicit specialization is to emit the type unit without any mention of this, and to emit the implicit specialization declaration into the stub type in the CU (that references the type unit)) Without type units I'd be pretty surprised if you couldn't call the implicit specialization at least from the CU in which it was instantiated.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 11:41 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 14 Jun 2018 at 19:29, Pavel Labath <<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>> wrote:<br>
><br>
> On Thu, 14 Jun 2018 at 19:26, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On Thu, Jun 14, 2018 at 11:24 AM Pavel Labath <<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>> wrote:<br>
> >><br>
> >> On Thu, 14 Jun 2018 at 17:58, Greg Clayton <<a href="mailto:clayborg@gmail.com" target="_blank">clayborg@gmail.com</a>> wrote:<br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> > On Jun 14, 2018, at 9:36 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> > On Jun 14, 2018, at 7:01 AM, Pavel Labath via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> >> ><br>
> >> > Thank you all. I am going to try to reply to all comments in a single email.<br>
> >> ><br>
> >> > Regarding the  .apple_objc idea, I am afraid the situation is not as<br>
> >> > simple as just flipping a switch.<br>
> >> ><br>
> >> ><br>
> >> > Jonas is currently working on adding the support for DWARF5-style Objective-C accelerator tables to LLVM/LLDB/dsymutil. Based on the assumption that DWARF 4 and earlier are unaffected by any of this, I don't think it's necessary to spend any effort of making the transition smooth. I'm fine with having Objective-C on DWARF 5 broken on trunk for two weeks until Jonas is done adding Objective-C support to the DWARF 5 implementation.<br>
> >><br>
> >> Ideally, I would like to enable the accelerator tables (possibly with<br>
> >> a different version number or something) on DWARF 4 too (on non-apple<br>
> >> targets only). The reason for this is that their absence if causing<br>
> >> large slowdowns when debugging on non-apple platforms, and I wouldn't<br>
> >> want to wait for dwarf 5 for that to go away (I mean no disrespect to<br>
> >> Paul and DWARF 5 effort in general, but even if all of DWARF 5 in llvm<br>
> >> was done tomorrow, there would still be lldb, which hasn't even begun<br>
> >> to look at this version).<br>
> >><br>
> >> That said, if you are working on the Objective C support right now,<br>
> >> then I am happy to wait two weeks or so that we have a full<br>
> >> implementation from the get-go.<br>
> >><br>
> >> > But, other options may be possible as well. What's not clear to me is<br>
> >> > whether these tables couldn't be replaced by extra information in the<br>
> >> > .debug_info section. It seems to me that these tables are trying to<br>
> >> > work around the issue that there is no straight way to go from a<br>
> >> > DW_TAG_structure type DIE describing an ObjC class to it's methods. If<br>
> >> > these methods (their forward declarations) were be present as children<br>
> >> > of the type DIE (as they are for c++ classes), then these tables may<br>
> >> > not be necessary. But maybe (probably) that has already been<br>
> >> > considered and deemed infeasible for some reason. In any case this<br>
> >> > seemed like a thing best left for people who actually work on ObjC<br>
> >> > support to figure out.<br>
> >> ><br>
> >> ><br>
> >> > That's really a question for Greg or Jim — I don't know why the current representation has the Objective-C methods outside of the structs. One reason might be that an interface's implementation can define more methods than are visible in its public interface in the header file, but we already seem to be aware of this and mark the implementation with DW_AT_APPLE_objc_complete_type. I also am not sure that this is the *only* reason for the objc accelerator table. But I'd like to learn.<br>
> >><br>
> >> My observation was based on studying lldb code. The only place where<br>
> >> the objc table is used is in the AppleDWARFIndex::GetObjCMethods<br>
> >> function, which is called from<br>
> >> SymbolFileDWARF::GetObjCMethodDIEOffsets, whose only caller is<br>
> >> DWARFASTParserClang::CompleteTypeFromDWARF, which seems to have a<br>
> >> class DIE as an argument. However, if not all declarations of a<br>
> >> class/interface have access to the full list of methods then this<br>
> >> might be a problem for the approach I suggested.<br>
> ><br>
> ><br>
> > Maybe, but the same is actually true for C++ classes too (see my comments in another reply about implicit specializations of class member templates (and there are a couple of other examples)) - so might be worth considering how those are handled/could be improved, and maybe in fixing those we could improve/normalize the ObjC representation and avoid the need for ObjC tables... maybe.<br>
> ><br>
><br>
> That's a good point! I need to check out how we handle that right now.<br>
<br>
Apparently we handle that very poorly. :/ I wasn't even able to call<br>
the instantiation which was present in the CU I was stopped in. I<br>
didn't even get to the part about trying an instantiation from a<br>
different CU.<br>
</blockquote></div>