jankratochvil updated this revision to Diff 135817.
jankratochvil marked an inline comment as done.
https://reviews.llvm.org/D43512
Files:
packages/Python/lldbsuite/test/decorators.py
packages/Python/lldbsuite/test/linux/buildidsymlink/Makefile
packages/Python/lldbsuite/test/linux/buildidsymlink/TestTargetSymbolsBuildidSymlink.py
packages/Python/lldbsuite/test/linux/buildidsymlink/main.c
source/Host/common/Symbols.cpp
Index: source/Host/common/Symbols.cpp
===
--- source/Host/common/Symbols.cpp
+++ source/Host/common/Symbols.cpp
@@ -283,6 +283,8 @@
if (llvm::sys::fs::equivalent(file_spec.GetPath(),
module_file_spec.GetPath()))
continue;
+if (FileSystem::ResolveSymbolicLink(file_spec, file_spec).Fail())
+ continue;
if (file_spec.Exists()) {
lldb_private::ModuleSpecList specs;
Index: packages/Python/lldbsuite/test/linux/buildidsymlink/main.c
===
--- /dev/null
+++ packages/Python/lldbsuite/test/linux/buildidsymlink/main.c
@@ -0,0 +1,6 @@
+struct s {
+ int i1, i2, i3, i4, i5, i6, i7, i8, i9;
+} v;
+int main() {
+ return 0;
+}
Index: packages/Python/lldbsuite/test/linux/buildidsymlink/TestTargetSymbolsBuildidSymlink.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/linux/buildidsymlink/TestTargetSymbolsBuildidSymlink.py
@@ -0,0 +1,24 @@
+""" Testing separate debug info loading for base binary with a symlink. """
+import os
+import time
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTargetSymbolsBuildidSymlink(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@no_debug_info_test # Prevent the genaration of the dwarf version of this test
+@skipUnlessPlatform(['linux'])
+@skipIf(hostoslist=["windows"])
+@skipIfRemote # llvm.org/pr36237
+@skipUnlessDWZInstalled
+def test_target_symbols_buildid_symlink(self):
+self.build(clean=True)
+exe = self.getBuildArtifact("stripped.out")
+
+lldbutil.run_to_name_breakpoint(self, "main", exe_name = exe)
Index: packages/Python/lldbsuite/test/linux/buildidsymlink/Makefile
===
--- /dev/null
+++ packages/Python/lldbsuite/test/linux/buildidsymlink/Makefile
@@ -0,0 +1,24 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+LD_EXTRAS += -Wl,--build-id=sha1
+
+all: .build-id
+
+.PHONY: .build-id
+stripped.out stripped.debug stripped.debug.dwz: a.out
+ eu-strip --remove-comment -f stripped.debug -F stripped.debugx -o stripped.out $<
+ cp -p stripped.debug stripped.debug.dup
+ dwz -m stripped.debug.dwz stripped.debug stripped.debug.dup
+
+.build-id: stripped.debug
+ $(OBJCOPY) -j .note.gnu.build-id -O binary $< tmp
+ rm -rf .build-id
+ fn=`od -An -tx1 ___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits