This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 01/22] [GDBserver] Multi-process + multi-arch: core + GNU/Linux x86*
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 30 May 2013 13:00:29 +0100
- Subject: Re: [PATCH 01/22] [GDBserver] Multi-process + multi-arch: core + GNU/Linux x86*
- References: <20130529162434 dot 24586 dot 5697 dot stgit at brno dot lan> <20130529162452 dot 24586 dot 9557 dot stgit at brno dot lan> <87mwrdtxqa dot fsf at fleche dot redhat dot com>
On 05/29/2013 08:03 PM, Tom Tromey wrote:
> Pedro> diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c
> Pedro> index dc20a15..d0c40c9 100644
> Pedro> --- a/gdb/gdbserver/linux-amd64-ipa.c
> Pedro> +++ b/gdb/gdbserver/linux-amd64-ipa.c
> Pedro> @@ -23,6 +23,9 @@
> Pedro> /* Defined in auto-generated file amd64-linux.c. */
> Pedro> void init_registers_amd64_linux (void);
>
> Pedro> +/* Ditto. */
> Pedro> +extern struct target_desc *tdesc_amd64_linux;
>
> It seems like this (and other instances) could be const.
Good idea.
While at it, I noticed the since the globals in the generated
files, are now accessed through the target_desc globals, can/should
be made static:
-const char *expedite_regs_tilegx[] = { "sp", "lr", "pc", 0 };
-const char *xmltarget_tilegx = 0;
+static const char *expedite_regs_tilegx[] = { "sp", "lr", "pc", 0 };
+static const char *xmltarget_tilegx = 0;
I did the necessary change to regdat.sh.
> Pedro> struct reg *
> Pedro> -find_register_by_name (const char *name)
> Pedro> +find_register_by_name (struct target_desc *tdesc, const char *name)
>
> How about const here?
>
> Pedro> int
> Pedro> -find_regno (const char *name)
> Pedro> +find_regno (struct target_desc *tdesc, const char *name)
>
> And here and other similar spots?
Yes, a bunch of other spots. :-)
Did the adjustment now across the whole series.
Good old grep is telling I didn't miss any spot.
> Pedro> +struct target_desc
> Pedro> +{
> Pedro> + /* An array of NUM_REGISTERS elements of register definitions that
> Pedro> + description the inferior's register set. */
> Pedro> + struct reg *reg_defs;
>
> I think it should be "...that describe...".
Indeed. Thanks!
v3 coming up...
--
Pedro Alves