]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / watchpoint / watchpoint_on_vectors / TestValueOfVectorVariable.py
1 """
2 Test displayed value of a vector variable while doing watchpoint operations
3 """
4
5 from __future__ import print_function
6
7
8 import os
9 import time
10 import lldb
11 from lldbsuite.test.decorators import *
12 from lldbsuite.test.lldbtest import *
13 from lldbsuite.test import lldbutil
14
15
16 class TestValueOfVectorVariableTestCase(TestBase):
17
18     mydir = TestBase.compute_mydir(__file__)
19
20     # Watchpoints not supported
21     @expectedFailureAndroid(archs=['arm', 'aarch64'])
22     @expectedFailureAll(
23         oslist=["windows"],
24         bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
25     def test_value_of_vector_variable_using_watchpoint_set(self):
26         """Test verify displayed value of vector variable."""
27         self.build(dictionary=self.d)
28         self.setTearDownCleanup(dictionary=self.d)
29         self.value_of_vector_variable_with_watchpoint_set()
30
31     def setUp(self):
32         # Call super's setUp().
33         TestBase.setUp(self)
34         # Our simple source filename.
35         self.source = 'main.c'
36         self.exe_name = 'a.out'
37         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
38
39     def value_of_vector_variable_with_watchpoint_set(self):
40         """Test verify displayed value of vector variable"""
41         exe = os.path.join(os.getcwd(), 'a.out')
42         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
43
44         # Set break to get a frame
45         self.runCmd("b main")
46
47         # Run the program.
48         self.runCmd("run", RUN_SUCCEEDED)
49
50         # Value of a vector variable should be displayed correctly
51         self.expect(
52             "watchpoint set variable global_vector",
53             WATCHPOINT_CREATED,
54             substrs=['new value: (1, 2, 3, 4)'])