Skip to content

Commit e21be17

Browse files
committed
Add API test to verify that stats dump does not load symbols
1 parent 55580d9 commit e21be17

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lldb/test/API/commands/statistics/basic/TestStats.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,31 @@ def test_default_no_run(self):
209209
)
210210
self.assertGreater(module_stats["symbolsLoaded"], 0)
211211

212+
213+
def test_default_no_run_no_preload_symbols(self):
214+
"""Test "statistics dump" without running the target and without
215+
preloading symbols.
216+
217+
Checks that symbol count are zero.
218+
"""
219+
# Make sure symbols will not be preloaded.
220+
self.runCmd("settings set target.preload-symbols false")
221+
222+
# Build and load the target
223+
self.build()
224+
target = self.createTestTarget()
225+
226+
# Get statistics
227+
debug_stats = self.get_stats()
228+
229+
# No symbols should be loaded
230+
self.assertEqual(debug_stats["totalSymbolsLoaded"], 0)
231+
232+
# No symbols should be loaded in each module
233+
for module_stats in debug_stats["modules"]:
234+
self.assertEqual(module_stats["symbolsLoaded"], 0)
235+
236+
212237
def test_default_with_run(self):
213238
"""Test "statistics dump" when running the target to a breakpoint.
214239

0 commit comments

Comments
 (0)