Blob Blame History Raw
commit f666d20249ff381dfc9bf5a621c544560527af40
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date:   Wed May 22 10:21:08 2013 +0000

    Support PTRACE_GET/SET_THREAD_AREA on x86.
    BZ#320063.  (Josh Stone, jistone@redhat.com)
    
    git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13403 a5019735-40e9-0310-863c-91ae7b9d1cf9

diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index 7e75899..ed60a15 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1118,6 +1118,10 @@ PRE(sys_ptrace)
       PRE_MEM_WRITE( "ptrace(getfpxregs)", ARG4, 
                      sizeof(struct vki_user_fxsr_struct) );
       break;
+   case VKI_PTRACE_GET_THREAD_AREA:
+      PRE_MEM_WRITE( "ptrace(get_thread_area)", ARG4, 
+                     sizeof(struct vki_user_desc) );
+      break;
    case VKI_PTRACE_SETREGS:
       PRE_MEM_READ( "ptrace(setregs)", ARG4, 
 		     sizeof (struct vki_user_regs_struct));
@@ -1130,6 +1134,10 @@ PRE(sys_ptrace)
       PRE_MEM_READ( "ptrace(setfpxregs)", ARG4, 
                      sizeof(struct vki_user_fxsr_struct) );
       break;
+   case VKI_PTRACE_SET_THREAD_AREA:
+      PRE_MEM_READ( "ptrace(set_thread_area)", ARG4, 
+                     sizeof(struct vki_user_desc) );
+      break;
    case VKI_PTRACE_GETEVENTMSG:
       PRE_MEM_WRITE( "ptrace(geteventmsg)", ARG4, sizeof(unsigned long));
       break;
@@ -1167,6 +1175,9 @@ POST(sys_ptrace)
    case VKI_PTRACE_GETFPXREGS:
       POST_MEM_WRITE( ARG4, sizeof(struct vki_user_fxsr_struct) );
       break;
+   case VKI_PTRACE_GET_THREAD_AREA:
+      POST_MEM_WRITE( ARG4, sizeof(struct vki_user_desc) );
+      break;
    case VKI_PTRACE_GETEVENTMSG:
       POST_MEM_WRITE( ARG4, sizeof(unsigned long));
       break;
diff --git a/include/vki/vki-x86-linux.h b/include/vki/vki-x86-linux.h
index 7c072d6..adfcb08 100644
--- a/include/vki/vki-x86-linux.h
+++ b/include/vki/vki-x86-linux.h
@@ -812,6 +812,8 @@ struct vki_shminfo64 {
 #define VKI_PTRACE_SETFPREGS          15
 #define VKI_PTRACE_GETFPXREGS         18
 #define VKI_PTRACE_SETFPXREGS         19
+#define VKI_PTRACE_GET_THREAD_AREA    25
+#define VKI_PTRACE_SET_THREAD_AREA    26
 
 //----------------------------------------------------------------------
 // From linux-2.6.15.4/include/asm-i386/vm86.h