Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: Check gdbarch_ptr_bit for x32 core dump
@ 2012-05-11 19:33 H.J. Lu
  2012-05-11 20:30 ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2012-05-11 19:33 UTC (permalink / raw)
  To: GDB

Hi,

This patch checks gdbarch_ptr_bit for x32 core dump.  Tested on
Linux/x86-64.  Ok to install?

Thanks.

H.J.
---
	* amd64-linux-tdep.c (amd64_linux_core_read_description): Check
	gdbarch_ptr_bit for x32 core dump.

diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index acc7303..601ce20 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1273,9 +1290,15 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
   switch ((xcr0 & I386_XSTATE_AVX_MASK))
     {
     case I386_XSTATE_AVX_MASK:
-      return tdesc_amd64_avx_linux;
+      if (gdbarch_ptr_bit (gdbarch) == 32)
+	return tdesc_x32_avx_linux;
+      else
+	return tdesc_amd64_avx_linux;
     default:
-      return tdesc_amd64_linux;
+      if (gdbarch_ptr_bit (gdbarch) == 32)
+	return tdesc_x32_linux;
+      else
+	return tdesc_amd64_linux;
     }
 }
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: Check gdbarch_ptr_bit for x32 core dump
  2012-05-11 19:33 PATCH: Check gdbarch_ptr_bit for x32 core dump H.J. Lu
@ 2012-05-11 20:30 ` Mark Kettenis
  2012-05-11 21:01   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2012-05-11 20:30 UTC (permalink / raw)
  To: hjl.tools; +Cc: gdb-patches

> Date: Fri, 11 May 2012 12:33:36 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
> 
> Hi,
> 
> This patch checks gdbarch_ptr_bit for x32 core dump.  Tested on
> Linux/x86-64.  Ok to install?

This is ok once the diff to add tde definitions for tdesc_x32_linux
and tdesc_x32_avx_linux to amd64-linux-tdep.h is in.

> 
> Thanks.
> 
> H.J.
> ---
> 	* amd64-linux-tdep.c (amd64_linux_core_read_description): Check
> 	gdbarch_ptr_bit for x32 core dump.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: Check gdbarch_ptr_bit for x32 core dump
  2012-05-11 20:30 ` Mark Kettenis
@ 2012-05-11 21:01   ` H.J. Lu
  2012-05-11 22:12     ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2012-05-11 21:01 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Fri, May 11, 2012 at 1:29 PM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Fri, 11 May 2012 12:33:36 -0700
>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>>
>> Hi,
>>
>> This patch checks gdbarch_ptr_bit for x32 core dump.  Tested on
>> Linux/x86-64.  Ok to install?
>
> This is ok once the diff to add tde definitions for tdesc_x32_linux
> and tdesc_x32_avx_linux to amd64-linux-tdep.h is in.
>

This won't work since desc_x32_linux and tdesc_x32_avx_linux are
defined by

diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index acc7303..601ce20 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -42,6 +42,8 @@

 #include "features/i386/amd64-linux.c"
 #include "features/i386/amd64-avx-linux.c"
+#include "features/i386/x32-linux.c"
+#include "features/i386/x32-avx-linux.c"

in

http://sourceware.org/ml/gdb-patches/2012-05/msg00437.html

Can I apply the above change together with the additional change in
amd64-linux-tdep.h?

Thanks.


-- 
H.J.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: Check gdbarch_ptr_bit for x32 core dump
  2012-05-11 21:01   ` H.J. Lu
@ 2012-05-11 22:12     ` Mark Kettenis
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Kettenis @ 2012-05-11 22:12 UTC (permalink / raw)
  To: hjl.tools; +Cc: gdb-patches

> Date: Fri, 11 May 2012 14:00:47 -0700
> From: "H.J. Lu" <hjl.tools@gmail.com>
>
> > This is ok once the diff to add tde definitions for tdesc_x32_linux
> > and tdesc_x32_avx_linux to amd64-linux-tdep.h is in.
> >
> 
> This won't work since desc_x32_linux and tdesc_x32_avx_linux are
> defined by
> 
> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index acc7303..601ce20 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -42,6 +42,8 @@
> 
>  #include "features/i386/amd64-linux.c"
>  #include "features/i386/amd64-avx-linux.c"
> +#include "features/i386/x32-linux.c"
> +#include "features/i386/x32-avx-linux.c"
> 
> in
> 
> http://sourceware.org/ml/gdb-patches/2012-05/msg00437.html
> 
> Can I apply the above change together with the additional change in
> amd64-linux-tdep.h?

You mean just adding those includes?  Yes that's fine.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-11 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 19:33 PATCH: Check gdbarch_ptr_bit for x32 core dump H.J. Lu
2012-05-11 20:30 ` Mark Kettenis
2012-05-11 21:01   ` H.J. Lu
2012-05-11 22:12     ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox