Finding class template instantiations via runtime reflection (for openmethods)

Jean-Louis Leroy jl at leroy.nyc
Tue Sep 26 16:08:38 UTC 2017


On Tuesday, 26 September 2017 at 15:59:01 UTC, Jacob Carlborg 
wrote:
> On 2017-09-25 16:24, Jean-Louis Leroy wrote:
>> On Monday, 25 September 2017 at 14:17:13 UTC, Jacob Carlborg 
>> wrote:
>>> Of course, that's a bit of a PITA, but you would not be 
>>> dependent on any bugs getting fixed or new 
>>> features/improvements implemented.
>> 
>> How do you do that?
>
> On Posix you use "dlopen", passing in null as the filename to 
> get a handle to the current executable. Then you iterate the 
> sections until you find the symbol table. For macOS there's 
> this reference for the Mach-O binary format [1]. For Mach-O 
> files there's this helper function as well [3].
>
> [1] 
> https://web.archive.org/web/20090901205800/http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
>
> [2] getsectbynamefromheader_64

Ah, I suspected that. I don't want to go down that path, what of 
Windows? But thanks anyway...


More information about the Digitalmars-d mailing list