[Lldb-commits] [PATCH] D26300: ELF core: Adding parsing of the floating-point and SSE registers on x86 32/64 bit elf core files

Dimitar Vlahovski via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 4 11:07:29 PDT 2016


dvlahovski created this revision.
dvlahovski added a reviewer: labath.
dvlahovski added a subscriber: lldb-commits.

The floating-point and SSE registers could be present in the elf-core
file in the note NT_FPREGSET for 64 bit ones, and in the note
NT_PRXFPREG for 32 bit ones.

The entire note is a binary blob matching the layout of the x87 save
area that gets generated by the FXSAVE instruction (see Intel developers
manual for more information).

This CL mainly modifies the RegisterRead function in
RegisterContextPOSIXCore_x86_64 for it to return the correct data both
for GPR and FPR/SSE registers, and return false (meaning "this register
is not available") for other registers.

I added a test to TestElfCore.py that tests reading FPR/SSE registers
both from a 32 and 64 bit elf-core file and I have inluded the source
which I used to generate the core files.

I tried to also add support for the AVX registers, because this info could
also be present in the elf-core file (note NT_X86_XSTATE - that is the result of
the newer XSAVE instruction). Parsing the contents from the file is
easy. The problem is that the ymm registers are split into two halves
and they are in different places in the note. For making this work one
would either make a "hacky" approach, because there won't be
any other way with the current state of the register contexts - they
assume that "this register is of size N and at offset M" and
don't have the notion of discontinuos registers.


https://reviews.llvm.org/D26300

Files:
  packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
  packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/fpr_sse.cpp
  packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/fpr_sse_i386.core
  packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/fpr_sse_x86_64.core
  source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_i386.h
  source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
  source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
  source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
  source/Plugins/Process/Utility/RegisterInfoInterface.h
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26300.76918.patch
Type: text/x-patch
Size: 13143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161104/d111fb99/attachment.bin>


More information about the lldb-commits mailing list