Skip to content

Commit ab2abc2

Browse files
authored
Merge pull request #25 from access-softek/dil-local-vars
Clean up DIL API python tests.
2 parents 2398045 + 8ad318f commit ab2abc2

File tree

40 files changed

+193
-230
lines changed

40 files changed

+193
-230
lines changed

lldb/test/API/commands/frame/var-dil/basics/AddressOf/TestFrameVarDILFullAddressOf.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
#self.expect("settings set target.experimental.use-DIL true",
60-
# substrs=[""])
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
6161
self.expect("frame variable '&x'", patterns=["0x[0-9]+"])
6262
self.expect("frame variable 'r'", substrs=["42"])
6363
self.expect("frame variable '&r'", patterns=["0x[0-9]+"])
@@ -105,10 +105,6 @@ def do_test(self):
105105
substrs=["cannot take the address of an rvalue of type "
106106
"'int'"])
107107

108-
self.expect("frame variable '&this'", error=True,
109-
substrs=["cannot take the address of an rvalue of type "
110-
"'TestMethods *'"])
111-
112108
self.expect("frame variable '&(&s_str)'", error=True,
113109
substrs=["cannot take the address of an rvalue of type "
114110
"'const char **'"])

lldb/test/API/commands/frame/var-dil/basics/AddressOf/TestFrameVarDILStrippedAddressOf.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
@@ -66,57 +66,21 @@ def do_test(self):
6666
self.expect("frame variable 'my_pr'", patterns=["0x[0-9]+"])
6767
self.expect("frame variable '&my_pr'", patterns=["0x[0-9]+"])
6868

69-
#self.expect("frame variable '&x == &r'", substrs=["true"])
70-
#self.expect("frame variable '&x != &r'", substrs=["false"])
71-
72-
#self.expect("frame variable '&p == &pr'", substrs=["true"])
73-
#self.expect("frame variable '&p != &pr'", substrs=["false"])
74-
#self.expect("frame variable '&p == &my_pr'", substrs=["true"])
75-
#self.expect("frame variable '&p != &my_pr'", substrs=["false"])
76-
7769
self.expect("frame variable '&globalVar'", patterns=["0x[0-9]+"])
7870
self.expect("frame variable '&s_str'", patterns=["0x[0-9]+"])
7971
self.expect("frame variable '&param'", patterns=["0x[0-9]+"])
8072

81-
#self.expect("frame variable '&(true ? x : x)'",
82-
# patterns=["0x[0-9]+"])
83-
#self.expect("frame variable '&(true ? c : c)'",
84-
# patterns=["0x[0-9]+"])
85-
8673
self.expect("frame variable '&externGlobalVar'", error=True,
8774
substrs=["use of undeclared identifier 'externGlobalVar'"])
88-
#substrs=["no variable or instance variable named 'externGlobalVar' found in this frame"])
8975

9076
self.expect("frame variable '&1'", error=True,
9177
substrs=["cannot take the address of an rvalue of type "
9278
"'int'"])
93-
#substrs=["no variable or instance variable named '1' found in this frame"])
9479

9580
self.expect("frame variable '&0.1'", error=True,
9681
substrs=["cannot take the address of an rvalue of type "
9782
"'double'"])
98-
#substrs=["no variable or instance variable named '0' found in this frame"])
99-
100-
#self.expect("frame variable '&(true ? 1 : 1)'", error=True,
101-
# substrs=["cannot take the address of an rvalue of type "
102-
# "'int'"])
103-
104-
#self.expect("frame variable '&(true ? c : (char)1)'", error=True,
105-
# substrs=["cannot take the address of an rvalue of type "
106-
# "'char'"])
107-
#self.expect("frame variable '&(true ? c : 1)'", error=True,
108-
# substrs=["cannot take the address of an rvalue of type "
109-
# "'int'"])
110-
111-
#self.expect("frame variable '&this'", error=True,
112-
# substrs=["cannot take the address of an rvalue of type "
113-
# "'TestMethods *'"])
114-
self.expect("frame variable '&this'", error=True,
115-
substrs=["cannot take the address of an rvalue of type "
116-
"'TestMethods *'"])
117-
#patterns=["0x[0-9]+"])
11883

11984
self.expect("frame variable '&(&s_str)'", error=True,
12085
substrs=["cannot take the address of an rvalue of type "
12186
"'const char **'"])
122-
#substrs=["no variable or instance variable named '(' found in this frame"])

lldb/test/API/commands/frame/var-dil/basics/BitField/TestFrameVarDILFullBitField.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ def do_test(self):
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
5252
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
#self.expect("settings set target.experimental.use-DIL true",
60-
# substrs=[""])
61-
#
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
61+
6262
# TestBitField
6363
#
6464
self.expect("frame variable 'bf.a'", substrs=["1023"])

lldb/test/API/commands/frame/var-dil/basics/BitField/TestFrameVarDILStrippedBitField.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()

lldb/test/API/commands/frame/var-dil/basics/BitwiseOperators/TestFrameVarDILFullBitwiseOperators.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
#self.expect("settings set target.experimental.use-DIL true",
60-
# substrs=[""])
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
6161
#
6262
# TestBitwiseOperators
6363
#
@@ -68,8 +68,8 @@ def do_test(self):
6868
self.expect("frame variable '~~0'", substrs=["0"])
6969
self.expect("frame variable '~0'", substrs=["-1"])
7070
self.expect("frame variable '~1'", substrs=["-2"])
71-
#self.expect("frame variable '~0LL'", substrs=["-1"])
72-
#self.expect("frame variable '~1LL'", substrs=["-2"])
71+
self.expect("frame variable '~0LL'", substrs=["-1"])
72+
self.expect("frame variable '~1LL'", substrs=["-2"])
7373
self.expect("frame variable '~true'", substrs=["-2"])
7474
self.expect("frame variable '~false'", substrs=["-1"])
7575
self.expect("frame variable '~var_true'", substrs=["-2"])
@@ -87,16 +87,16 @@ def do_test(self):
8787
self.expect("frame variable '(-1 >> 10)'", substrs=["-1"])
8888
self.expect("frame variable '(-100 >> 5)'", substrs=["-4"])
8989
self.expect("frame variable '(-3 << 6)'", substrs=["-192"])
90-
#self.expect("frame variable '(2000000000U << 1)'", substrs=["4000000000"])
91-
#self.expect("frame variable '(-1 >> 1U)'", substrs=["-1"])
90+
self.expect("frame variable '(2000000000U << 1)'", substrs=["4000000000"])
91+
self.expect("frame variable '(-1 >> 1U)'", substrs=["-1"])
9292
self.expect("frame variable '(char)1 << 16'", substrs=["65536"])
93-
#self.expect("frame variable '(signed char)-123 >> 8'", substrs=["-1"])
93+
self.expect("frame variable '(signed char)-123 >> 8'", substrs=["-1"])
9494

95-
#self.expect("frame variable '0b1011 & 0xFF'", substrs=["11"])
96-
#self.expect("frame variable '0b1011 & mask_ff'", substrs=["11"])
97-
#self.expect("frame variable '0b1011 & 0b0111'", substrs=["3"])
98-
#self.expect("frame variable '0b1011 | 0b0111'", substrs=["15"])
99-
#self.expect("frame variable -- '-0b1011 | 0xFF'", substrs=["-1"])
100-
#self.expect("frame variable -- '-0b1011 | 0xFFu'", substrs=["4294967295"])
101-
#self.expect("frame variable '0b1011 ^ 0b0111'", substrs=["12"])
102-
#self.expect("frame variable '~0b1011'", substrs=["-12"])
95+
self.expect("frame variable '0b1011 & 0xFF'", substrs=["11"])
96+
self.expect("frame variable '0b1011 & mask_ff'", substrs=["11"])
97+
self.expect("frame variable '0b1011 & 0b0111'", substrs=["3"])
98+
self.expect("frame variable '0b1011 | 0b0111'", substrs=["15"])
99+
self.expect("frame variable -- '-0b1011 | 0xFF'", substrs=["-1"])
100+
self.expect("frame variable -- '-0b1011 | 0xFFu'", substrs=["4294967295"])
101+
self.expect("frame variable '0b1011 ^ 0b0111'", substrs=["12"])
102+
self.expect("frame variable '~0b1011'", substrs=["-12"])

lldb/test/API/commands/frame/var-dil/basics/BitwiseOperators/TestFrameVarDILStrippedBitwiseOperators.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,24 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
#self.expect("settings set target.experimental.use-DIL true",
60-
# substrs=[""])
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
6161
#
6262
# TestBitwiseOperators
6363
#
6464
#self.expect("frame variable '~(-1)'", substrs=["0"])
6565
#self.expect("frame variable '~~0'", substrs=["0"])
6666
#self.expect("frame variable '~0'", substrs=["-1"])
6767
#self.expect("frame variable '~1'", substrs=["-2"])
68-
#self.expect("frame variable '~0LL'", substrs=["-1"])
69-
#self.expect("frame variable '~1LL'", substrs=["-2"])
68+
self.expect("frame variable '~0LL'", substrs=["-1"])
69+
self.expect("frame variable '~1LL'", substrs=["-2"])
7070
#self.expect("frame variable '~true'", substrs=["-2"])
7171
#self.expect("frame variable '~false'", substrs=["-1"])
7272
#self.expect("frame variable '~var_true'", substrs=["-2"])
@@ -84,16 +84,16 @@ def do_test(self):
8484
#self.expect("frame variable '(-1 >> 10)'", substrs=["-1"])
8585
#self.expect("frame variable '(-100 >> 5)'", substrs=["-4"])
8686
#self.expect("frame variable '(-3 << 6)'", substrs=["-192"])
87-
#self.expect("frame variable '(2000000000U << 1)'", substrs=["4000000000"])
88-
#self.expect("frame variable '(-1 >> 1U)'", substrs=["-1"])
89-
#self.expect("frame variable '(char)1 << 16'", substrs=["65536"])
87+
self.expect("frame variable '(2000000000U << 1)'", substrs=["4000000000"])
88+
self.expect("frame variable '(-1 >> 1U)'", substrs=["-1"])
89+
self.expect("frame variable '(char)1 << 16'", substrs=["65536"])
9090
#self.expect("frame variable '(signed char)-123 >> 8'", substrs=["-1"])
9191

92-
#self.expect("frame variable '0b1011 & 0xFF'", substrs=["11"])
93-
#self.expect("frame variable '0b1011 & mask_ff'", substrs=["11"])
94-
#self.expect("frame variable '0b1011 & 0b0111'", substrs=["3"])
95-
#self.expect("frame variable '0b1011 | 0b0111'", substrs=["15"])
96-
#self.expect("frame variable -- '-0b1011 | 0xFF'", substrs=["-1"])
97-
#self.expect("frame variable -- '-0b1011 | 0xFFu'", substrs=["4294967295"])
98-
#self.expect("frame variable '0b1011 ^ 0b0111'", substrs=["12"])
99-
#self.expect("frame variable '~0b1011'", substrs=["-12"])
92+
self.expect("frame variable '0b1011 & 0xFF'", substrs=["11"])
93+
self.expect("frame variable '0b1011 & mask_ff'", substrs=["11"])
94+
self.expect("frame variable '0b1011 & 0b0111'", substrs=["3"])
95+
self.expect("frame variable '0b1011 | 0b0111'", substrs=["15"])
96+
self.expect("frame variable -- '-0b1011 | 0xFF'", substrs=["-1"])
97+
self.expect("frame variable -- '-0b1011 | 0xFFu'", substrs=["4294967295"])
98+
self.expect("frame variable '0b1011 ^ 0b0111'", substrs=["12"])
99+
self.expect("frame variable '~0b1011'", substrs=["-12"])

lldb/test/API/commands/frame/var-dil/basics/GlobalVariableLookup/TestFrameVarDILFullGlobalVariableLookup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,15 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
60-
#self.expect("settings set target.experimental.use-DIL true",
61-
# substrs=[""])
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
6261
self.expect("frame variable 'globalVar'", substrs=["-559038737"]) # 0xDEADBEEF
6362
self.expect("frame variable 'globalPtr'", patterns=["0x[0-9]+"])
6463
self.expect("frame variable 'globalRef'", substrs=["-559038737"])

lldb/test/API/commands/frame/var-dil/basics/GlobalVariableLookup/TestFrameVarDILStrippedGlobalVariableLookup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
@@ -62,6 +62,7 @@ def do_test(self):
6262
self.expect("frame variable 'globalVar'", substrs=["-559038737"]) # 0xDEADBEEF
6363
self.expect("frame variable 'globalPtr'", patterns=["0x[0-9]+"])
6464
self.expect("frame variable 'globalRef'", substrs=["-559038737"])
65+
self.expect("frame variable '::globalVar'", substrs=["-559038737"]) # 0xDEADBEEF
6566
self.expect("frame variable '::globalPtr'", patterns=["0x[0-9]+"])
6667
self.expect("frame variable '::globalRef'", substrs=["-559038737"])
6768

lldb/test/API/commands/frame/var-dil/basics/Indirection/TestFrameVarDILFullIndirection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()
5757
interp = self.dbg.GetCommandInterpreter()
5858

59-
#self.expect("settings set target.experimental.use-DIL true",
60-
# substrs=[""])
59+
self.expect("settings set target.experimental.use-DIL true",
60+
substrs=[""])
6161
self.expect("frame variable '*p'", substrs=["1"])
6262
self.expect("frame variable 'p'", patterns=["0x[0-9]+"])
6363
self.expect("frame variable '*my_p'", substrs=["1"])

lldb/test/API/commands/frame/var-dil/basics/Indirection/TestFrameVarDILStrippedIndirection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def do_test(self):
4949
self.assertEqual(
5050
len(threads), 1, "There should be a thread stopped at our breakpoint"
5151
)
52-
# The hit count for the breakpoint should be 1.
53-
self.assertEquals(breakpoint.GetHitCount(), 1)
52+
# The hit count for the breakpoint should be 1.
53+
self.assertEqual(breakpoint.GetHitCount(), 1)
5454

5555
frame = threads[0].GetFrameAtIndex(0)
5656
command_result = lldb.SBCommandReturnObject()

0 commit comments

Comments
 (0)