* linux-x86-low.c (ps_get_thread_area): Properly extend address to
authorDoug Evans <dje@google.com>
Fri, 31 May 2013 19:14:33 +0000 (19:14 +0000)
committerDoug Evans <dje@google.com>
Fri, 31 May 2013 19:14:33 +0000 (19:14 +0000)
64 bits in 64-cross-32 environment.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-x86-low.c

index bbdac13fc6e634c0d56e41a2c85405102ca68e10..fb0eed6eb7292553d0aaab32db896ac186c24c4d 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-31  Doug Evans  <dje@google.com>
+
+       * linux-x86-low.c (ps_get_thread_area): Properly extend address to
+       64 bits in 64-cross-32 environment.
+
 2013-05-28  Pedro Alves  <palves@redhat.com>
 
        * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
index 1d1df95713729dc432250536011736be00fea4d4..dfe78b1836712ed243646284fda40d1e75769f5b 100644 (file)
@@ -196,7 +196,8 @@ ps_get_thread_area (const struct ps_prochandle *ph,
                (void *) (intptr_t) idx, (unsigned long) &desc) < 0)
       return PS_ERR;
 
-    *(int *)base = desc[1];
+    /* Ensure we properly extend the value to 64-bits for x86_64.  */
+    *base = (void *) (uintptr_t) desc[1];
     return PS_OK;
   }
 }