[Lldb-commits] [PATCH] D101086: [lldb] [Process/elf-core] Fix reading FPRs from FreeBSD/i386 cores

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 12 02:52:00 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb6c0edb9792c: [lldb] [Process/elf-core] Fix reading FPRs from FreeBSD/i386 cores (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101086/new/

https://reviews.llvm.org/D101086

Files:
  lldb/source/Plugins/Process/elf-core/RegisterUtilities.h
  lldb/test/Shell/Register/Core/x86-32-freebsd-addr.test
  lldb/test/Shell/Register/Core/x86-32-freebsd-fp.test


Index: lldb/test/Shell/Register/Core/x86-32-freebsd-fp.test
===================================================================
--- /dev/null
+++ lldb/test/Shell/Register/Core/x86-32-freebsd-fp.test
@@ -0,0 +1,3 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-32-freebsd.core | FileCheck %p/Inputs/x86-fp.check
+
+register read --all
Index: lldb/test/Shell/Register/Core/x86-32-freebsd-addr.test
===================================================================
--- lldb/test/Shell/Register/Core/x86-32-freebsd-addr.test
+++ lldb/test/Shell/Register/Core/x86-32-freebsd-addr.test
@@ -10,4 +10,7 @@
 # CHECK-DAG: ds = 0x0000003b
 # CHECK-DAG: es = 0x0000003b
 
-# TODO: fix reading fp registers
+# CHECK-DAG: fiseg = 0x00000000
+# CHECK-DAG: fioff = 0x00401c52
+# CHECK-DAG: foseg = 0x00000000
+# CHECK-DAG: fooff = 0xffffd8b8
Index: lldb/source/Plugins/Process/elf-core/RegisterUtilities.h
===================================================================
--- lldb/source/Plugins/Process/elf-core/RegisterUtilities.h
+++ lldb/source/Plugins/Process/elf-core/RegisterUtilities.h
@@ -96,6 +96,9 @@
                         llvm::ArrayRef<RegsetDesc> RegsetDescs);
 
 constexpr RegsetDesc FPR_Desc[] = {
+    // FreeBSD/i386 core NT_FPREGSET is x87 FSAVE result but the XSAVE dump
+    // starts with FXSAVE struct, so use that instead if available.
+    {llvm::Triple::FreeBSD, llvm::Triple::x86, llvm::ELF::NT_X86_XSTATE},
     {llvm::Triple::FreeBSD, llvm::Triple::UnknownArch, llvm::ELF::NT_FPREGSET},
     // In a i386 core file NT_FPREGSET is present, but it's not the result
     // of the FXSAVE instruction like in 64 bit files.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101086.344745.patch
Type: text/x-patch
Size: 1634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210512/85932eb5/attachment.bin>


More information about the lldb-commits mailing list