<div dir="ltr">But then wouldn't the appropriate way to do it be to send a request to the debugserver which would then ask its PlatformMacOSX, which would find out it's the local platform, and then call into the Host layer? Even remote debugging from MacOSX -> MacOSX, it's possible that some value returned by the host layer (we'll use the bundle directory since it was the original example) might be different on the two machines. Now your #if defined(__APPLE__) preprocessor check passes, you get the bundle directory from the host layer, and it's different from the value on the remote.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 10:07 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
> On Aug 20, 2014, at 4:29 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
><br>
> There are many examples of this, but just to pick one at random, PlatformDarwin::GetSharedModule() has a codepath which calls Host::GetBundleDirectory. This is probably the correct thing to do if it's the local platform, but it seems to be always the wrong thing to do if this is not the local platform. Is there something I'm misunderstanding that makes this work? Shouldn't this kind of thing be behind an IsHost() check?<br>
<br>
</div>No. If you are remote debugging a MacOSX app, the platform should still be able to find the bundle directory.<br>
<br>
windows% lldb<br>
(lldb) platform select remote-macosx<br>
(lldb) file Foo.app<br>
<br>
That being said, the code that uses native code to find the bundle directory should be placed into the Host directory and then PlatformDarwin should check #if defined(__APPLE__) and only use the host layer if it is running on Apple and fall back to other code when not native.<br>
<span class="HOEnZb"><font color="#888888"><br>
Greg<br>
<br>
</font></span></blockquote></div><br></div>