[Lldb-commits] [PATCH] D42852: Fix upper->lower case for /usr/lib/debug/.build-id/**.debug
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 5 02:48:53 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL324222: Fix upper->lower case for /usr/lib/debug/.build-id/**.debug (authored by jankratochvil, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D42852?vs=132668&id=132797#toc
Repository:
rL LLVM
https://reviews.llvm.org/D42852
Files:
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/Makefile
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/main.c
lldb/trunk/source/Host/common/Symbols.cpp
Index: lldb/trunk/source/Host/common/Symbols.cpp
===================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp
+++ lldb/trunk/source/Host/common/Symbols.cpp
@@ -245,6 +245,8 @@
// Some debug files are stored in the .build-id directory like this:
// /usr/lib/debug/.build-id/ff/e7fe727889ad82bb153de2ad065b2189693315.debug
uuid_str = module_uuid.GetAsString("");
+ std::transform(uuid_str.begin(), uuid_str.end(), uuid_str.begin(),
+ ::tolower);
uuid_str.insert(2, 1, '/');
uuid_str = uuid_str + ".debug";
}
Index: lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/main.c
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/main.c
+++ lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/main.c
@@ -0,0 +1,3 @@
+int main() {
+ return 0;
+}
Index: lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
+++ lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py
@@ -0,0 +1,21 @@
+""" Testing separate debug info loading by its .build-id. """
+import os
+import time
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTargetSymbolsBuildidCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test # Prevent the genaration of the dwarf version of this test
+ @skipUnlessPlatform(['linux'])
+ def test_target_symbols_buildid_case(self):
+ self.build(clean=True)
+ exe = self.getBuildArtifact("stripped.out")
+
+ lldbutil.run_to_name_breakpoint(self, "main", exe_name = exe)
Index: lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/Makefile
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/Makefile
@@ -0,0 +1,20 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+LD_EXTRAS += -Wl,--build-id=sha1
+
+all: stripped.out
+
+.PHONY: .build-id
+stripped.out .build-id: a.out
+ $(OBJCOPY) -j .note.gnu.build-id -O binary $< tmp
+ rm -rf .build-id
+ fn=`od -An -tx1 <tmp|tr -d ' \n'|sed -e 's/^.\{32\}//' -e 's#^..#.build-id/&/#' -e 's#$$#.debug#'` && \
+ mkdir -p `dirname $$fn` && \
+ $(OBJCOPY) --only-keep-debug $< $$fn && \
+ $(OBJCOPY) --strip-all --add-gnu-debuglink=$$fn $< stripped.out
+ $(RM) tmp
+
+clean::
+ $(RM) -r stripped.out .build-id
+
+include $(LEVEL)/Makefile.rules
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42852.132797.patch
Type: text/x-patch
Size: 2844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180205/35760a08/attachment.bin>
More information about the lldb-commits
mailing list