xref: /llvm-project-15.0.7/lldb/test/API/functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py (revision e60f2cbd)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import lldb
2from lldbsuite.test.lldbtest import *
3from lldbsuite.test.decorators import *
4import lldbsuite.test.lldbutil as lldbutil
5
6
7class TestDataFormatterCaching(TestBase):
8
9    mydir = TestBase.compute_mydir(__file__)
10
11    def test_with_run_command(self):
12        """
13        Test that hardcoded summary formatter matches aren't improperly cached.
14        """
15        self.build()
16        target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
17            self, 'break here', lldb.SBFileSpec('a.c'))
18        valobj = self.frame().FindVariable('f')
19        self.assertEqual(valobj.GetValue(), '4')
20        bkpt_b = target.BreakpointCreateBySourceRegex('break here',
21                                                      lldb.SBFileSpec('b.c'))
22        lldbutil.continue_to_breakpoint(process, bkpt_b)
23        valobj = self.frame().FindVariable('f4')
24        self.assertEqual(valobj.GetSummary(), '(1, 2, 3, 4)')
25

served by {OpenGrok

Last Index Update: Tue Oct 21 18:42:31 GMT 2025