Re: PATCH: 6/6 [3rd try]: Add AVX support (gdbserver changes)

Daniel Jacobowitz
2010-04-02T17:39:40Z

On Tue, Mar 30, 2010 at 09:48:33AM -0700, H.J. Lu wrote:
> OK to install?

Pretty much OK.

> +#ifdef __x86_64__
> + if (num_xmm_registers == 8)
> + init_registers_i386_linux ();
> + else
> + init_registers_amd64_linux ();
> +#else
> + init_registers_i386_linux ();
> +#endif

...

> + /* Update gdbserver_xmltarget with XML support. */
> +#ifdef __x86_64__
> + if (num_xmm_registers == 8)
> + gdbserver_xmltarget = "i386-linux.xml";
> + else
> + gdbserver_xmltarget = "amd64-linux.xml";
> +#else
> + gdbserver_xmltarget = "i386-linux.xml";
> +#endif

Isn't the second block redundant with the first block?

> +/* Process qSupported query, "xmlRegisters=". Update the buffer size for
> + PTRACE_GETREGSET. */
> +
> +static void
> +x86_linux_process_qsupported (const char *query)
> +{
> + /* Return if gdb doesn't support XML. If gdb sends "xmlRegisters="
> + in qSupported query, it supports x86 XML target descriptions. */
> + use_xml = query != NULL && strncmp (query, "xmlRegisters=", 13) == 0;
> +
> + x86_linux_update_xmltarget ();
> +}

Presumably, the protocol-wise correct thing to do would be to
search for "xmlRegisters=" that had an element "x86".

Otherwise OK.

--
Daniel Jacobowitz
CodeSourcery