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

2020-08-26 Thread Taylor Simpson


> -Original Message-
> From: Richard Henderson 
> Sent: Wednesday, August 26, 2020 7:52 AM
> To: Taylor Simpson ; qemu-devel@nongnu.org
> Cc: phi...@redhat.com; laur...@vivier.eu; riku.voi...@iki.fi;
> aleksandar.m.m...@gmail.com; a...@rev.ng
> Subject: Re: [RFC PATCH v3 06/34] Hexagon (disas) disassembler
>
> Normally our disassemblers print the instruction address; sometimes the raw
> bytes (or word) of the instruction.

OK



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

2020-08-26 Thread Richard Henderson
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, )) {
> +snprint_a_pkt(buf, bufsize, );
> +return pkt.encod_pkt_size_in_bytes;
> +} else {
> +snprintf(buf, bufsize, "");
> +return 0;
> +}

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


r~