Skip to content

Commit 6842bc5

Browse files
author
ccc
committed
fix(LLDB): Repair OC_Bridge variable display issue when load-on-demand is true
When symbols.load-on-demand is enabled in LLDB, variables from OC-bridged Swift objects were not being displayed. This was due to SymbolFileOndemand not correctly overriding the GetAstData method, causing it to return an empty implementation from the base SymbolFile class. This commit fixes the issue by providing the correct implementation of GetAstData in SymbolFileOndemand, ensuring that the necessary AST data is loaded and OC-bridged variables can be correctly resolved and displayed during debugging.
1 parent 9c3961f commit 6842bc5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lldb/include/lldb/Symbol/SymbolFileOnDemand.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ class SymbolFileOnDemand : public lldb_private::SymbolFile {
178178

179179
void PreloadSymbols() override;
180180

181+
std::vector<lldb::DataBufferSP> GetASTData(lldb::LanguageType language) override;
182+
181183
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
182184
lldb_private::StatsDuration::Duration GetDebugInfoParseTime() override;
183185
lldb_private::StatsDuration::Duration GetDebugInfoIndexTime() override;

lldb/source/Symbol/SymbolFileOnDemand.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,15 @@ void SymbolFileOnDemand::PreloadSymbols() {
535535
return m_sym_file_impl->PreloadSymbols();
536536
}
537537

538+
std::vector<lldb::DataBufferSP> SymbolFileOnDemand::GetASTData(lldb::LanguageType language) {
539+
if (!m_debug_info_enabled) {
540+
LLDB_LOG(GetLog(), "[{0}] {1} is skipped", GetSymbolFileName(),
541+
__FUNCTION__);
542+
return {};
543+
}
544+
return m_sym_file_impl->GetASTData(language);
545+
}
546+
538547
uint64_t SymbolFileOnDemand::GetDebugInfoSize(bool load_all_debug_info) {
539548
// Always return the real debug info size.
540549
LLDB_LOG(GetLog(), "[{0}] {1} is not skipped", GetSymbolFileName(),

0 commit comments

Comments
 (0)