Skip to content

Commit 68c8884

Browse files
author
Tom Yang
committed
[lldb][split-dwarf] implement GetSeparateDebugInfo for
SymbolFileOnDemand
1 parent f4e3fb5 commit 68c8884

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

lldb/include/lldb/Symbol/SymbolFileOnDemand.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ class SymbolFileOnDemand : public lldb_private::SymbolFile {
228228
return m_sym_file_impl->SetDebugInfoHadFrameVariableErrors();
229229
}
230230

231+
bool GetSeparateDebugInfo(StructuredData::Dictionary &d,
232+
bool errors_only) override {
233+
return m_sym_file_impl->GetSeparateDebugInfo(d, errors_only);
234+
}
235+
231236
lldb::TypeSP MakeType(lldb::user_id_t uid, ConstString name,
232237
std::optional<uint64_t> byte_size,
233238
SymbolContextScope *context,

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,6 +2691,7 @@ class CommandObjectTargetModulesDumpSeparateDebugInfoFiles
26912691
"Found unsupported debug info type '%s'.\n",
26922692
type.str().c_str());
26932693
}
2694+
strm.EOL();
26942695
return true;
26952696
});
26962697
}

lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,29 @@ def test_dwos_not_loaded_table_output(self):
130130
"0x[a-zA-Z0-9]{16}\s+E\s+.*foo\.dwo",
131131
],
132132
)
133+
134+
@skipIfRemote
135+
@skipIfDarwin
136+
@skipIfWindows
137+
def test_dwos_loaded_symbols_on_demand(self):
138+
self.build()
139+
exe = self.getBuildArtifact("a.out")
140+
main_dwo = self.getBuildArtifact("main.dwo")
141+
foo_dwo = self.getBuildArtifact("foo.dwo")
142+
143+
# Make sure dwo files exist
144+
self.assertTrue(os.path.exists(main_dwo), f'Make sure "{main_dwo}" file exists')
145+
self.assertTrue(os.path.exists(foo_dwo), f'Make sure "{foo_dwo}" file exists')
146+
147+
# Load symbols on-demand
148+
self.runCmd("settings set symbols.load-on-demand true")
149+
150+
target = self.dbg.CreateTarget(exe)
151+
self.assertTrue(target, lldbtest.VALID_TARGET)
152+
153+
self.runCmd("target modules dump separate-debug-info --json")
154+
155+
# Check the output
156+
output = self.get_dwos_from_json_output()
157+
self.assertTrue(output[exe]["main.dwo"]["loaded"])
158+
self.assertTrue(output[exe]["foo.dwo"]["loaded"])

0 commit comments

Comments
 (0)