In our project we are using remote client-server LLDB configuration.
We want to parse as much debugging symbols as we can before debugger starts attachment to the remote process.
To do that we are passing the path of the local executable module to CreateTarget method at the client.
But, it seems that this method are not parsing the executable module symbols.
To fix this I added PreloadSymbols call for executable module to target creation method.
Another problem is that after attaching to a process, DynamicLoader tries to resolve the executable.
To do this, it compares the target executable module with the executable module from the remote process only by path + architecture.
Since the local path to the executable module and the remote path may differ, the DynamicLoader decides to reset the target executable module.
Which leads to the re-parsing of the module symbols after.
To fix this, I added a GetModuleSpec call from the Dynamic Loader.
This call gets full module information from remote process, including the UUID.
Now you can remove this else branch and un-indent the code inside.