qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v3 06/34] Hexagon (disas) disassembler


From: Richard Henderson
Subject: Re: [RFC PATCH v3 06/34] Hexagon (disas) disassembler
Date: Wed, 26 Aug 2020 06:52:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 8/18/20 8:50 AM, Taylor Simpson wrote:
> +    len = disassemble_hexagon(words, i, buf, PACKET_BUFFER_LEN);
> +    slen = strlen(buf);
> +    if (buf[slen - 1] == '\n') {
> +        buf[slen - 1] = '\0';
> +    }
> +    (*info->fprintf_func)(info->stream, "%s", buf);

Normally our disassemblers print the instruction address; sometimes the raw
bytes (or word) of the instruction.

Looking forward to patch 14 where disassemble_hexagon is defined, I see none of
that.  Indeed, if disassembly fails, we get...

> +    if (decode_this(nwords, words, &pkt)) {
> +        snprint_a_pkt(buf, bufsize, &pkt);
> +        return pkt.encod_pkt_size_in_bytes;
> +    } else {
> +        snprintf(buf, bufsize, "<invalid>");
> +        return 0;
> +    }

... no indication at all what happened or where, just "<invalid>".  That's not
going to make it easy to find problems.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]