This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 10/25] Adjust code generated by regformats/regdat.sh
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Tue, 20 Jun 2017 12:09:33 +0100
- Subject: Re: [PATCH 10/25] Adjust code generated by regformats/regdat.sh
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 985E9C04D294
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 985E9C04D294
- References: <1497256916-4958-1-git-send-email-yao.qi@linaro.org> <1497256916-4958-11-git-send-email-yao.qi@linaro.org>
On 06/12/2017 09:41 AM, Yao Qi wrote:
> regformats/regdat.sh generate some *-generated.c files when GDBserver
> is built. Each .c file has some static variables, which are only used
> within function init_registers_XXX, like this,
>
> static struct reg regs_i386_linux[] = {
> { "eax", 0, 32 },
> { "ecx", 32, 32 },
> ...
> };
>
> static const char *expedite_regs_i386_linux[] = { "ebp", "esp", "eip", 0 };
> static const char *xmltarget_i386_linux = "i386-linux.xml";
>
> void
> init_registers_i386_linux (void)
> {
> ...
> }
>
> This patch moves these static variables' definitions to function
> init_registers_XXX, so the generated files look like this,
>
The rationale misses stating why is this better than the status quo.
I presume this helps following patches?
Thanks,
Pedro Alves