[PATCH v2] arc: Migrate to new target features
Simon Marchi
simark@simark.ca
Sun Mar 8 04:16:46 GMT 2020
On 2020-03-07 6:54 p.m., Shahab Vahedi wrote:
> From: Anton Kolesov <Anton.Kolesov@synopsys.com>
>
> This patch replaces usage of target descriptions in ARC, where the whole
> description is fixed in XML, with new target descriptions where XML describes
> individual features, and GDB assembles those features into actual target
> description.
Hi Shahab,
The patch is ok, with the nit below fixed.
Also, I remembered that other architectures that use feature-based target descriptions
cache the target descriptions, such that if you request a tdesc with the same features
twice, the exact same instance is returned. See for example:
- amd64_linux_read_description
- arm_read_description
I can't remember if this is just a simple optimization or if it's actually required...
> diff --git a/gdb/arch/arc.h b/gdb/arch/arc.h
> new file mode 100644
> index 00000000000..dc7871c3103
> --- /dev/null
> +++ b/gdb/arch/arc.h
> @@ -0,0 +1,20 @@
> +/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
> +
> + This file is part of GDB.
> +
> + This program is free software; you can redistribute it and/or modify
> + it under the terms of the GNU General Public License as published by
> + the Free Software Foundation; either version 3 of the License, or
> + (at your option) any later version.
> +
> + This program is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + GNU General Public License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> +
> +#include "gdbsupport/tdesc.h"
> +
> +target_desc *arc_create_target_description (bool print_debug, bool is_arcv2);
This file (arc.h) is missing include guards.
Simon
More information about the Gdb-patches
mailing list