Re: [PATCH v2 2/4] arc: Recognize registers available on Linux targets

Shahab Vahedi
2020-06-17T15:46:53Z

Hi Simon,

On Thu, May 14, 2020 at 11:01:44AM -0400, Simon Marchi wrote:
> Just some nits - I don't really know about the specific details of the ARC architecture.
>
> On 2020-04-28 12:04 p.m., Shahab Vahedi via Gdb-patches wrote:
> > struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep);
> >
> > /* Data types. */
> > @@ -1987,6 +2025,13 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> > set_gdbarch_ps_regnum (gdbarch, ARC_STATUS32_REGNUM);
> > set_gdbarch_fp0_regnum (gdbarch, -1); /* No FPU registers. */
> >
> > + /* Confirm that register name lists have proper length. */
> > + gdb_static_assert (ARC_LAST_REGNUM + 1
> > + == (ARRAY_SIZE (core_v2_register_names)
> > + + ARRAY_SIZE (aux_minimal_register_names)));
> > + gdb_static_assert (ARRAY_SIZE (core_v2_register_names)
> > + == ARRAY_SIZE (core_arcompact_register_names));
>
> Does this need to be here? I would expect them to be near (just after) the definitions
> of said arrays.

*_register_names are static arrays. That should be why gdb_STATIC_assert
is used as well. I believe this place in the code is OK for making that
check.

Shahab