summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-11-08 10:17:38 +0000
committerGitHub <noreply@github.com>2023-11-08 10:17:38 +0000
commite28157e778423fd9d39c9065ef06e841fc320f09 (patch)
tree02e09d1f428aa8129297ce958cd387cea25af379 /lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
parent567c02a80e828a7c6864b1497be1e06de9ec0462 (diff)
[lldb][AArch64][Linux] Add field information for the CPSR register (#70300)
The contents of which are mostly SPSR_EL1 as shown in the Arm manual, with a few adjustments for things Linux says userspace shouldn't concern itself with. ``` (lldb) register read cpsr cpsr = 0x80001000 = (N = 1, Z = 0, C = 0, V = 0, SS = 0, IL = 0, ... ``` Some fields are always present, some depend on extensions. I've checked for those extensions using HWCAP and HWCAP2. To provide this for core files and live processes I've added a new class LinuxArm64RegisterFlags. This is a container for all the registers we'll want to have fields and handles detecting fields and updating register info. This is used by the native process as follows: * There is a global LinuxArm64RegisterFlags object. * The first thread takes a mutex on it, and updates the fields. * Subsequent threads see that detection is already done, and skip it. * All threads then update their own copy of the register information with pointers to the field information contained in the global object. This means that even though every thread will have the same fields, we only detect them once and have one copy of the information. Core files instead have a LinuxArm64RegisterFlags as a member, because each core file could have different saved capabilities. The logic from there is the same but we get HWACP values from the corefile note. This handler class is Linux specific right now, but it can easily be made more generic if needed. For example by using LLVM's FeatureBitset instead of HWCAPs. Updating register info is done with string comparison, which isn't ideal. For CPSR, we do know the register number ahead of time but we do not for other registers in dynamic register sets. So in the interest of consistency, I'm going to use string comparison for all registers including cpsr. I've added tests with a core file and live process. Only checking for fields that are always present to account for CPU variance.
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py')
0 files changed, 0 insertions, 0 deletions