[PATCHv3 2/2] libopcodes/aarch64: add support for disassembler styling

Andrew Burgess aburgess@redhat.com
Thu Jul 7 10:44:59 GMT 2022


Andrew Burgess via Binutils <binutils@sourceware.org> writes:

<snip>

> diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
> index 1c93f836020..b6de4c96baf 100644
> --- a/opcodes/aarch64-opc.c
> +++ b/opcodes/aarch64-opc.c
> @@ -35,6 +35,36 @@
>  int debug_dump = false;
>  #endif /* DEBUG_AARCH64 */
>  
> +/* ... */
> +static int
> +debug_snprintf (char *str, size_t size, int lineno, const char *fmt, ...)
> +{
> +  char tmp[1024];
> +  va_list ap;
> +  int res;
> +  static bool init;
> +  static bool debug_p;
> +  if (!init)
> +    {
> +      debug_p = getenv ("DEBUG_AARCH64") != NULL;
> +      init = true;
> +    }
> +
> +  if (debug_p)
> +    snprintf (tmp, sizeof (tmp), "<%d:%s>", lineno, fmt);	/* IGNORE.  */
> +  else
> +    snprintf (tmp, sizeof (tmp), "%s", fmt);			/* IGNORE.  */
> +
> +  va_start (ap, fmt);
> +  res = vsnprintf (str, size, tmp, ap);
> +  va_end (ap);
> +  return res;
> +}
> +
> +#define snprintf(BUF,LEN,FMT,...)                              \
> +  debug_snprintf (BUF, LEN, __LINE__, FMT, ##__VA_ARGS__)
> +

Once again, I've manged to leave this debug code in the posted patch.  I
even remembered that I needed to remove this, then did one final review
of the patch .... and forgot to actually remove it :/

I've now deleted this code from my local tree, and if this patch is
approved, this will not be included in the push.

Again ... I'm sorry.

Thanks,
Andrew



More information about the Binutils mailing list