[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.
This commit is contained in:
parent
86c1d075bb
commit
4ad19b80ea
@ -76,4 +76,22 @@ TEST_F(ObjectFileMachOTest, ModuleFromSharedCacheInfo) {
|
|||||||
// ... and one from the __DATA segment
|
// ... and one from the __DATA segment
|
||||||
check_symbol("OBJC_CLASS_$_NSObject");
|
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
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user