On 25.10.18 22:19, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarko...@wavecomp.com>
> 
> Add disassembler support for nanoMIPS.
> 
> Reviewed-by: Stefan Markovic <smarko...@wavecomp.com>
> Signed-off-by: Matthew Fortune <matthew.fort...@mips.com>
> Signed-off-by: Aleksandar Markovic <amarko...@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 via email to