[Lldb-commits] [PATCH] D15042: PTRACE ABI to read FXSAVE area for 32-bit inferior
Abhishek via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 30 04:13:04 PST 2015
abhishek.aggarwal updated this revision to Diff 41382.
abhishek.aggarwal added a comment.
Removed assert if ptrace API fails
http://reviews.llvm.org/D15042
Files:
packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
===================================================================
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -327,6 +327,9 @@
#ifndef NT_X86_XSTATE
#define NT_X86_XSTATE 0x202
#endif
+#ifndef NT_PRXFPREG
+#define NT_PRXFPREG 0x46e62b7f
+#endif
NativeRegisterContextLinux*
NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const ArchSpec& target_arch,
@@ -868,10 +871,24 @@
NativeRegisterContextLinux_x86_64::WriteFPR()
{
const FPRType fpr_type = GetFPRType ();
+ const lldb_private::ArchSpec& target_arch = GetRegisterInfoInterface().GetTargetArchitecture();
switch (fpr_type)
{
case FPRType::eFPRTypeFXSAVE:
- return NativeRegisterContextLinux::WriteFPR();
+ // For 32-bit inferiors on x86_32/x86_64 architectures,
+ // FXSAVE area can be written using PTRACE_SETREGSET ptrace api
+ // For 64-bit inferiors on x86_64 architectures,
+ // FXSAVE area can be written using PTRACE_SETFPREGS ptrace api
+ switch (target_arch.GetMachine ())
+ {
+ case llvm::Triple::x86:
+ return WriteRegisterSet(&m_iovec, sizeof(m_fpr.xstate.xsave), NT_PRXFPREG);
+ case llvm::Triple::x86_64:
+ return NativeRegisterContextLinux::WriteFPR();
+ default:
+ assert(false && "Unhandled target architecture.");
+ break;
+ }
case FPRType::eFPRTypeXSAVE:
return WriteRegisterSet(&m_iovec, sizeof(m_fpr.xstate.xsave), NT_X86_XSTATE);
default:
@@ -980,10 +997,24 @@
NativeRegisterContextLinux_x86_64::ReadFPR ()
{
const FPRType fpr_type = GetFPRType ();
+ const lldb_private::ArchSpec& target_arch = GetRegisterInfoInterface().GetTargetArchitecture();
switch (fpr_type)
{
case FPRType::eFPRTypeFXSAVE:
- return NativeRegisterContextLinux::ReadFPR();
+ // For 32-bit inferiors on x86_32/x86_64 architectures,
+ // FXSAVE area can be read using PTRACE_GETREGSET ptrace api
+ // For 64-bit inferiors on x86_64 architectures,
+ // FXSAVE area can be read using PTRACE_GETFPREGS ptrace api
+ switch (target_arch.GetMachine ())
+ {
+ case llvm::Triple::x86:
+ return ReadRegisterSet(&m_iovec, sizeof(m_fpr.xstate.xsave), NT_PRXFPREG);
+ case llvm::Triple::x86_64:
+ return NativeRegisterContextLinux::ReadFPR();
+ default:
+ assert(false && "Unhandled target architecture.");
+ break;
+ }
case FPRType::eFPRTypeXSAVE:
return ReadRegisterSet(&m_iovec, sizeof(m_fpr.xstate.xsave), NT_X86_XSTATE);
default:
Index: packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
+++ packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
@@ -16,7 +16,7 @@
mydir = TestBase.compute_mydir(__file__)
- @expectedFailurei386
+ @expectedFailureAll(oslist=["macosx","freebsd"], archs=["i386"])
@expectedFailureWindows("llvm.org/pr24778")
@add_test_categories(['pyapi'])
def test_with_python(self):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15042.41382.patch
Type: text/x-patch
Size: 3458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151130/813180f2/attachment.bin>
More information about the lldb-commits
mailing list