This is an archive of the discontinued LLVM Phabricator instance.

Fix Bug 36237 - TestTargetSymbolsSepDebugSymlink fails when run remotely
AbandonedPublic

Authored by jankratochvil on Feb 5 2018, 7:33 AM.

Details

Reviewers
labath
Summary

(In reply to labath from Bug 36237 comment #0)

The root problem is in Platform::Install. When given a symlink, it will try to create the same symlink on the target. However, Platform::CreateSymlink function is not implemented, but even if it was, the target is unlikely to contain anything at the place where the symlink points to. And even if it contain something, it would most likely be a different object than the debugger will obtain when it resolves the symlink locally.

lldb-server platform did create a symlink for me:

/tmp/lldbtest/1/linux/sepdebugsymlink:
lrwxrwxrwx 1 jkratoch jkratoch   23 Feb  5 15:59 stripped.symlink -> ../dirreal/stripped.out

But I haven't found how to transfer the binaries there, I tried a bit some AddModule+SetRemoteInstallFileSpec but it did not work and I did not try harder.

I think that a more reasonable behavior here would be to copy the file contents instead.

The symlink is essential for this testcase otherwise it does not test the bugfix. OK to just disable it for remote testing?

Diff Detail

Event Timeline

jankratochvil created this revision.Feb 5 2018, 7:33 AM
labath added a comment.Feb 5 2018, 7:46 AM

I think that a more reasonable behavior here would be to copy the file contents instead.

The symlink is essential for this testcase otherwise it does not test the bugfix. OK to just disable it for remote testing?

My comment you are quoting should applies to Platform::Install, not your test. I don't think there's anything special you should need to do in the test to make this work remotely. However, trying to copy a symlink to a remote system and expecting it will make sense there does not sound like a reasonable thing to do. That's why I created that bug, as I think it exposes a bug on our side (i.e. debugging a symlinked executable remotely will just not work).

I already added this decorator, so you can drop this diff. It would be ideal if the test worked remotely as well, but it seems the test fails due to reasons which are completely outside of the scope of your original patch.

Btw, you are right that the symlink does get created -- I was looking at the wrong implementation of CreateSymlink(). I'll update the bug accordingly.

jankratochvil abandoned this revision.Feb 5 2018, 8:16 AM