Skip to content

Commit a17c598

Browse files
committed
[lldb][test] Enable TestExpressionInSyscall.py on Windows
Relates to #22139 Just had to use the right win32 call instead of getpid. The original problem was something with expressions in general which was fixed at some point. Also make the test one method, there's no need to split it up.
1 parent c79fcfe commit a17c598

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,10 @@
77

88

99
class ExprSyscallTestCase(TestBase):
10-
@expectedFailureAll(
11-
oslist=["windows"],
12-
bugnumber="llvm.org/pr21765, getpid() does not exist on Windows",
13-
)
1410
@expectedFailureNetBSD
1511
def test_setpgid(self):
1612
self.build()
17-
self.expr_syscall()
1813

19-
def expr_syscall(self):
2014
# Create a target by the debugger.
2115
target = self.createTestTarget()
2216

@@ -65,7 +59,12 @@ def expr_syscall(self):
6559

6660
# try evaluating a couple of expressions in this state
6761
self.expect_expr("release_flag = 1", result_value="1")
68-
self.expect_expr("(int)getpid()", result_value=str(process.GetProcessID()))
62+
func = (
63+
"GetCurrentProcessId"
64+
if lldbplatformutil.getPlatform() == "windows"
65+
else "getpid"
66+
)
67+
self.expect_expr(f"(int){func}()", result_value=str(process.GetProcessID()))
6968

7069
# and run the process to completion
7170
process.Continue()

0 commit comments

Comments
 (0)