diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py index 9d79872b029a3..0cf9d4fde4948 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py @@ -195,6 +195,9 @@ def collect_console(self, duration): def get_local_as_int(self, name, threadId=None): value = self.dap_server.get_local_variable_value(name, threadId=threadId) + # 'value' may have the variable value and summary. + # Extract the variable value since summary can have nonnumeric characters. + value = value.split(" ")[0] if value.startswith("0x"): return int(value, 16) elif value.startswith("0"):