Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Andreas Schwab'" <schwab@linux-m68k.org>
Cc: <binutils@sourceware.org>, <gdb-patches@sourceware.org>
Subject: RE: [RFA] Fix gdb compilation error in opcodes/dlx-dis.c with --enable-targets=all for mingw64
Date: Thu, 09 Sep 2010 19:56:00 -0000	[thread overview]
Message-ID: <004001cb503c$9879a580$c96cf080$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <m262ye29eo.fsf@igel.home>

> What's wrong with dlx_insn?
> 
> Andreas.

  Whoops, nothing in fact...
It's just that as it was typecast to an integer,
I tried to find an integer type that was of the same size
as a pointer for all configurations. I found out
that bfd_hostptr_t was this type, so I went on using
that type.

  Of course you are right, it is much cleaner to directly
typecast it to the correct type.


Here is a new version of the patch.
Is this OK?


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

	* src/opcodes/dlx-dis.c (print_insn_dlx): Use dlx_insn 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,18 +437,18 @@ print_insn_dlx (bfd_vma memaddr, struct 
   bfd_byte buffer[4];
   int insn_idx;
   unsigned long insn_word;
-  unsigned long dlx_insn_type[] =
+  dlx_insn 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
+    dlx_r_type,
+    dlx_load_type,
+    dlx_store_type,
+    dlx_aluI_type,
+    dlx_br_type,
+    dlx_jmp_type,
+    dlx_jr_type,
+    (dlx_insn) NULL
   };
-  int dlx_insn_type_num = ((sizeof dlx_insn_type) / (sizeof (unsigned long))) - 1;
+  int dlx_insn_type_num = ((sizeof dlx_insn_type) / (sizeof (dlx_insn))) - 1;
   int status =
     (*info->read_memory_func) (memaddr, (bfd_byte *) &buffer[0], 4, info);
 
@@ -483,7 +483,7 @@ print_insn_dlx (bfd_vma memaddr, struct 
   current_insn_addr = (unsigned long) memaddr;
 
   for (insn_idx = 0; dlx_insn_type[insn_idx] != 0x0; insn_idx++)
-    switch (((dlx_insn) (dlx_insn_type[insn_idx])) (info))
+    switch (((dlx_insn_type[insn_idx])) (info))
       {
 	/* Found the correct opcode   */
       case R_TYPE:


  reply	other threads:[~2010-09-09 16:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2531.82755918733$1284046069@news.gmane.org>
2010-09-09 16:32 ` Andreas Schwab
2010-09-09 19:56   ` Pierre Muller [this message]
2010-09-10 13:47     ` Nick Clifton
2010-09-10 13:57       ` Pierre Muller
2010-09-09 16:16 Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004001cb503c$9879a580$c96cf080$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox