[RFA] Fix gdb compilation error in opcodes/dlx-dis.c with --enable-targets=all for mingw64

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Thu Sep 9 16:16:00 GMT 2010


  'unsigned long' type is 4-byte
on x86_64-w64-mingw systems, which is less
than a pointer size.
  After some searching, I found bfd_hostptr_t
type that is supposed to have the correct size of a host 
pointer.

  I tested the patch below by compilation 
with --enable-targets=all configure option
for i386-cygwin, x86_64-w64-mingw and x86_64-unknown-linux-gnu.

  I also ran the gdb testsuite on x86_64-unknown-linux-gnu
(gcc10 machine from gcc compile farm).
  No regression found.

  I don't know who is the main maintainer project
binutils or gdb?

  Who can give me the approval for this patch?
Is the patch itself OK?


Pierre Muller
Pascal language support maintainer for GDB


opcodes/ChangeLog entry:

2010-09-09  Pierre Muller  <muller@ics.u-strasbg.fr>

	* dlx-dis.c (print_insn_dlx): Use bfd_hostptr_t type for
	dlx_insn_type array.

Index: src/opcodes/dlx-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/dlx-dis.c,v
retrieving revision 1.5
diff -u -p -r1.5 dlx-dis.c
--- src/opcodes/dlx-dis.c	27 Jun 2010 04:07:55 -0000	1.5
+++ src/opcodes/dlx-dis.c	9 Sep 2010 12:06:19 -0000
@@ -437,16 +437,16 @@ print_insn_dlx (bfd_vma memaddr, struct 
   bfd_byte buffer[4];
   int insn_idx;
   unsigned long insn_word;
-  unsigned long dlx_insn_type[] =
+  bfd_hostptr_t dlx_insn_type[] =
   {
-    (unsigned long) dlx_r_type,
-    (unsigned long) dlx_load_type,
-    (unsigned long) dlx_store_type,
-    (unsigned long) dlx_aluI_type,
-    (unsigned long) dlx_br_type,
-    (unsigned long) dlx_jmp_type,
-    (unsigned long) dlx_jr_type,
-    (unsigned long) NULL
+    (bfd_hostptr_t) dlx_r_type,
+    (bfd_hostptr_t) dlx_load_type,
+    (bfd_hostptr_t) dlx_store_type,
+    (bfd_hostptr_t) dlx_aluI_type,
+    (bfd_hostptr_t) dlx_br_type,
+    (bfd_hostptr_t) dlx_jmp_type,
+    (bfd_hostptr_t) dlx_jr_type,
+    (bfd_hostptr_t) NULL
   };
   int dlx_insn_type_num = ((sizeof dlx_insn_type) / (sizeof (unsigned long))) - 1;
   int status =



More information about the Gdb-patches mailing list