[lldb-dev] Offset Calculations for Registers on Linux x86_64
Greg Clayton via lldb-dev
lldb-dev at lists.llvm.org
Mon Aug 17 11:28:38 PDT 2015
> On Aug 17, 2015, at 8:06 AM, Abhishek Aggarwal <abhiinnitald at gmail.com> wrote:
> Hi Greg
> Thanks for your reply. My next queries are based on the Bug 24457 that I filed 2-3 days ago.
> I analyzed and found the reason of this bug for x86_64-Linux platform.
> A solution to fix this bug requires change in the definition of macro FPR_OFFSET (defined in RegisterInfos_x86_64.h) to calculate offsets for fpr registers wrt to FPR structure (defined in RegisterContext_x86.h) and not wrt to UserArea structure (defined in RegisterContextLinux_x86_64.cpp).
> I am a bit unclear on your statements
> "All offsets should be the global offset in the register context's data" and
> "We just require that you append all register sets together into one chunk (GPR + FPR + ...)" in your last 2 replies.
> In context of this bug, do your statements mean that macro FPR_OFFSET will not be allowed to change?
The offset for each register should be the offset in the register context data buffer, so if the first FPU register currently has 128 as the offset, it shouldn't change to zero if that is the correct offset. If you are seeing issues and believe the offset should be zero, then the bug is somewhere else and needs to be fixed elsewhere. The linux plug-in might be expecting a zero based offset for some registers in some locations, but that should all be fixed within the RegisterContextLinuxx86_64 class.
More information about the lldb-dev