qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
	qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com
Subject: Re: [Qemu-devel] [PULL 3/3] target/mips: Add disassembler support for nanoMIPS
Date: Thu, 8 Nov 2018 09:00:02 +0100	[thread overview]
Message-ID: <03cea7f3-cbb7-6e4d-3104-01aba47cde09@weilnetz.de> (raw)
In-Reply-To: <1540498768-8736-4-git-send-email-aleksandar.markovic@rt-rk.com>

On 25.10.18 22:19, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> 
> Add disassembler support for nanoMIPS.
> 
> Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
> Signed-off-by: Matthew Fortune <matthew.fortune@mips.com>
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
>  MAINTAINERS           |     2 +
>  configure             |     3 +
>  disas/Makefile.objs   |     1 +
>  disas/nanomips.cpp    | 22242 ++++++++++++++++++++++++++++++++++++++++++++++++
>  disas/nanomips.h      |  1099 +++
>  include/disas/bfd.h   |     1 +
>  include/exec/poison.h |     1 +
>  target/mips/cpu.c     |    13 +-
>  8 files changed, 23360 insertions(+), 2 deletions(-)
>  create mode 100644 disas/nanomips.cpp
>  create mode 100644 disas/nanomips.h


Hi,

the disassembler needs more work for the next QEMU release: it uses lots
of wrong format strings which will result in wrong output at least on
big endian hosts.

This patch enables the compiler errors to see those bugs:

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 1238c2ff33..62be5b6d00 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -138,7 +138,7 @@ namespace img
         return a;
     }

-    std::string format(const char *format, ...)
+    std::string GCC_FMT_ATTR(1, 2) format(const char *format, ...)
     {
         char buffer[256];
         va_list args;

I also noticed that the code does not use POSIX data types but
introduces its own integer types in disas/nanomips.h. This should be
fixed, too, because it prevents the use of PRIu64 etc. in the format
strings.

Regards
Stefan Weil

  reply	other threads:[~2018-11-08  8:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 20:19 [Qemu-devel] [PULL 0/3] MIPS queue for October 2018 - part 3 Aleksandar Markovic
2018-10-25 20:19 ` [Qemu-devel] [PULL 1/3] target/mips: Add nanoMIPS CRC32 instruction pool Aleksandar Markovic
2018-10-25 20:19 ` [Qemu-devel] [PULL 2/3] target/mips: Implement emulation of nanoMIPS EVA instructions Aleksandar Markovic
2018-10-29 10:57   ` Peter Maydell
2018-10-29 11:14     ` Aleksandar Markovic
2018-10-25 20:19 ` [Qemu-devel] [PULL 3/3] target/mips: Add disassembler support for nanoMIPS Aleksandar Markovic
2018-11-08  8:00   ` Stefan Weil [this message]
2018-11-08  9:18     ` Aleksandar Markovic
2018-11-27 11:24     ` Peter Maydell
2018-11-27 12:27       ` Stefan Weil
2018-10-26 21:22 ` [Qemu-devel] [PULL 0/3] MIPS queue for October 2018 - part 3 Peter Maydell

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=03cea7f3-cbb7-6e4d-3104-01aba47cde09@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=aleksandar.markovic@rt-rk.com \
    --cc=amarkovic@wavecomp.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).