This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Save/restore TLS registers around expressions
ClosedPublic

Authored by DavidSpickett on Jul 28 2023, 1:04 AM.

Details

Summary

Previously lldb was storing them but not restoring them. Meaning that this function:

void expr(uint64_t value) {
  __asm__ volatile("msr tpidr_el0, %0" ::"r"(value));
}

When run from lldb:

(lldb) expression expr()

Would leave tpidr as value instead of the original value of the register.

A check for this scenario has been added to TestAArch64LinuxTLSRegisters.py,
which covers tpidr and the SME excluisve tpidr2 register when it's present.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jul 28 2023, 1:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 1:04 AM
DavidSpickett requested review of this revision.Jul 28 2023, 1:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 1:04 AM
omjavaid accepted this revision.Aug 3 2023, 5:01 AM

This looks good. Just a nit the summary seems to be using a lot pronouns. Could you kindly improve summary a little and add a one liner about expr_func and how it tests save/restore for future readers of this log.

This revision is now accepted and ready to land.Aug 3 2023, 5:01 AM
DavidSpickett edited the summary of this revision. (Show Details)Aug 3 2023, 5:15 AM