Skip to content

[lldb] Update two API tests to fix x86 Darwin failures #121380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,17 @@ def read_register_values(self, reg_infos, endian, thread_id=None):
p_response = context.get("p_response")
self.assertIsNotNone(p_response)
self.assertTrue(len(p_response) > 0)
self.assertFalse(p_response[0] == "E")

# on x86 Darwin, 4 GPR registers are often
# unavailable, this is expected and correct.
if (
self.getArchitecture() == "x86_64"
and self.platformIsDarwin()
and p_response[0] == "E"
):
values[reg_index] = 0
else:
self.assertFalse(p_response[0] == "E")

values[reg_index] = unpack_register_hex_unsigned(endian, p_response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def test_register_commands(self):
# could not be read. This is expected.
error_str_matched = True

if self.getArchitecture() == "x86_64" and self.platformIsDarwin():
# debugserver on x86 will provide ds/es/ss/gsbase when the
# kernel provides them, but most of the time they will be
# unavailable. So "register read -a" will report that
# 4 registers were unavailable, it is expected.
error_str_matched = True

self.expect(
"register read -a",
MISSING_EXPECTED_REGISTERS,
Expand Down
Loading