[Lldb-commits] [lldb] 4ad19b8 - [lldb] Test parsing the symtab with indirect symbols from the shared cache
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 23 21:14:01 PDT 2022
Author: Jonas Devlieghere
Date: 2022-03-23T21:13:55-07:00
New Revision: 4ad19b80eafa1505b8bb86eef84ffefcd20410a3
URL: https://github.com/llvm/llvm-project/commit/4ad19b80eafa1505b8bb86eef84ffefcd20410a3
DIFF: https://github.com/llvm/llvm-project/commit/4ad19b80eafa1505b8bb86eef84ffefcd20410a3.diff
LOG: [lldb] Test parsing the symtab with indirect symbols from the shared cache
This patch adds a test for b0dc2fae6025. That commit fixed a bug where
we could increment the indirect symbol offset every time we parsed the
symbol table.
Added:
Modified:
lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
Removed:
################################################################################
diff --git a/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp b/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
index 119be3822ccb9..0ef2d0b85fd36 100644
--- a/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
+++ b/lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.cpp
@@ -76,4 +76,22 @@ TEST_F(ObjectFileMachOTest, ModuleFromSharedCacheInfo) {
// ... and one from the __DATA segment
check_symbol("OBJC_CLASS_$_NSObject");
}
+
+TEST_F(ObjectFileMachOTest, IndirectSymbolsInTheSharedCache) {
+ SharedCacheImageInfo image_info = HostInfo::GetSharedCacheImageInfo(
+ "/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit");
+ ModuleSpec spec(FileSpec(), UUID(), image_info.data_sp);
+ lldb::ModuleSP module = std::make_shared<Module>(spec);
+
+ ObjectFile *OF = module->GetObjectFile();
+ ASSERT_TRUE(llvm::isa<ObjectFileMachO>(OF));
+ EXPECT_TRUE(
+ OF->GetArchitecture().IsCompatibleMatch(HostInfo::GetArchitecture()));
+
+ // Check that we can parse the symbol table several times over without
+ // crashing.
+ Symtab symtab(OF);
+ for (size_t i = 0; i < 10; i++)
+ OF->ParseSymtab(symtab);
+}
#endif
More information about the lldb-commits
mailing list