arc: Rename "arc_gdbarch_features" struct
"arc_gdbarch_features" is a data structure containing information about the ARC architecture: ISA version, register size, etc. This name is misleading, because although it carries the phrase "gdbarch", it has nothing to do with the type/interface in GDB. Traditionaly, "gdbarch" structures are only used for that purpose. To rectify this, this patch changes the name to "arc_arch_features". gdb/ChangeLog: * arch/arc.h: Rename "arc_gdbarch_features" to "arc_arch_features". * arc-tdep.h: Likewise. * arc-tdep.c: Likewise.
This commit is contained in:
parent
4849105512
commit
e4bd363f99
4 changed files with 26 additions and 19 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2020-10-07 Shahab Vahedi <shahab@synopsys.com>
|
||||||
|
|
||||||
|
* arch/arc.h: Rename "arc_gdbarch_features" to
|
||||||
|
"arc_arch_features".
|
||||||
|
* arc-tdep.h: Likewise.
|
||||||
|
* arc-tdep.c: Likewise.
|
||||||
|
|
||||||
2020-10-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
2020-10-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
||||||
|
|
||||||
* infcmd.c (attach_command): Remove the redundant call to
|
* infcmd.c (attach_command): Remove the redundant call to
|
||||||
|
|
|
@ -1883,11 +1883,11 @@ mach_type_to_arc_isa (const unsigned long mach)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common construction code for ARC_GDBARCH_FEATURES struct. If there
|
/* Common construction code for ARC_ARCH_FEATURES struct. If there
|
||||||
is no ABFD, then a FEATURE with default values is returned. */
|
is no ABFD, then a FEATURE with default values is returned. */
|
||||||
|
|
||||||
static arc_gdbarch_features
|
static arc_arch_features
|
||||||
arc_gdbarch_features_create (const bfd *abfd, const unsigned long mach)
|
arc_arch_features_create (const bfd *abfd, const unsigned long mach)
|
||||||
{
|
{
|
||||||
/* Use 4 as a fallback value. */
|
/* Use 4 as a fallback value. */
|
||||||
int reg_size = 4;
|
int reg_size = 4;
|
||||||
|
@ -1915,7 +1915,7 @@ arc_gdbarch_features_create (const bfd *abfd, const unsigned long mach)
|
||||||
case). */
|
case). */
|
||||||
arc_isa isa = mach_type_to_arc_isa (mach);
|
arc_isa isa = mach_type_to_arc_isa (mach);
|
||||||
|
|
||||||
return arc_gdbarch_features (reg_size, isa);
|
return arc_arch_features (reg_size, isa);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for obsolete core feature names in TDESC. */
|
/* Look for obsolete core feature names in TDESC. */
|
||||||
|
@ -2085,9 +2085,9 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc,
|
||||||
/* If target doesn't provide a description, use the default ones. */
|
/* If target doesn't provide a description, use the default ones. */
|
||||||
if (!tdesc_has_registers (tdesc_loc))
|
if (!tdesc_has_registers (tdesc_loc))
|
||||||
{
|
{
|
||||||
arc_gdbarch_features features
|
arc_arch_features features
|
||||||
= arc_gdbarch_features_create (info.abfd,
|
= arc_arch_features_create (info.abfd,
|
||||||
info.bfd_arch_info->mach);
|
info.bfd_arch_info->mach);
|
||||||
tdesc_loc = arc_lookup_target_description (features);
|
tdesc_loc = arc_lookup_target_description (features);
|
||||||
}
|
}
|
||||||
gdb_assert (tdesc_loc != nullptr);
|
gdb_assert (tdesc_loc != nullptr);
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STATIC_IN_GDB target_desc *
|
STATIC_IN_GDB target_desc *
|
||||||
arc_create_target_description (const struct arc_gdbarch_features &features)
|
arc_create_target_description (const struct arc_arch_features &features)
|
||||||
{
|
{
|
||||||
/* Create a new target description. */
|
/* Create a new target description. */
|
||||||
target_desc *tdesc = allocate_target_description ();
|
target_desc *tdesc = allocate_target_description ();
|
||||||
|
@ -84,10 +84,10 @@ arc_create_target_description (const struct arc_gdbarch_features &features)
|
||||||
#ifndef GDBSERVER
|
#ifndef GDBSERVER
|
||||||
|
|
||||||
/* Wrapper used by std::unordered_map to generate hash for features set. */
|
/* Wrapper used by std::unordered_map to generate hash for features set. */
|
||||||
struct arc_gdbarch_features_hasher
|
struct arc_arch_features_hasher
|
||||||
{
|
{
|
||||||
std::size_t
|
std::size_t
|
||||||
operator() (const arc_gdbarch_features &features) const noexcept
|
operator() (const arc_arch_features &features) const noexcept
|
||||||
{
|
{
|
||||||
return features.hash ();
|
return features.hash ();
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,14 @@ struct arc_gdbarch_features_hasher
|
||||||
|
|
||||||
/* Cache of previously created target descriptions, indexed by the hash
|
/* Cache of previously created target descriptions, indexed by the hash
|
||||||
of the features set used to create them. */
|
of the features set used to create them. */
|
||||||
static std::unordered_map<arc_gdbarch_features,
|
static std::unordered_map<arc_arch_features,
|
||||||
const target_desc_up,
|
const target_desc_up,
|
||||||
arc_gdbarch_features_hasher> arc_tdesc_cache;
|
arc_arch_features_hasher> arc_tdesc_cache;
|
||||||
|
|
||||||
/* See arch/arc.h. */
|
/* See arch/arc.h. */
|
||||||
|
|
||||||
const target_desc *
|
const target_desc *
|
||||||
arc_lookup_target_description (const struct arc_gdbarch_features &features)
|
arc_lookup_target_description (const struct arc_arch_features &features)
|
||||||
{
|
{
|
||||||
/* Lookup in the cache first. If found, return the pointer from the
|
/* Lookup in the cache first. If found, return the pointer from the
|
||||||
"target_desc_up" type which is a "unique_ptr". This should be fine
|
"target_desc_up" type which is a "unique_ptr". This should be fine
|
||||||
|
|
|
@ -27,9 +27,9 @@ enum arc_isa
|
||||||
ARC_ISA_ARCV2 /* such as ARC EM and ARC HS */
|
ARC_ISA_ARCV2 /* such as ARC EM and ARC HS */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct arc_gdbarch_features
|
struct arc_arch_features
|
||||||
{
|
{
|
||||||
arc_gdbarch_features (int reg_size, arc_isa isa)
|
arc_arch_features (int reg_size, arc_isa isa)
|
||||||
: reg_size (reg_size), isa (isa)
|
: reg_size (reg_size), isa (isa)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -41,13 +41,13 @@ struct arc_gdbarch_features
|
||||||
const arc_isa isa;
|
const arc_isa isa;
|
||||||
|
|
||||||
/* Equality operator. */
|
/* Equality operator. */
|
||||||
bool operator== (const struct arc_gdbarch_features &rhs) const
|
bool operator== (const struct arc_arch_features &rhs) const
|
||||||
{
|
{
|
||||||
return (reg_size == rhs.reg_size && isa == rhs.isa);
|
return (reg_size == rhs.reg_size && isa == rhs.isa);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inequality operator. */
|
/* Inequality operator. */
|
||||||
bool operator!= (const struct arc_gdbarch_features &rhs) const
|
bool operator!= (const struct arc_arch_features &rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ struct arc_gdbarch_features
|
||||||
the returned data. */
|
the returned data. */
|
||||||
|
|
||||||
target_desc *arc_create_target_description
|
target_desc *arc_create_target_description
|
||||||
(const struct arc_gdbarch_features &features);
|
(const struct arc_arch_features &features);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ target_desc *arc_create_target_description
|
||||||
If nothing is found, then create one and return it. */
|
If nothing is found, then create one and return it. */
|
||||||
|
|
||||||
const target_desc *arc_lookup_target_description
|
const target_desc *arc_lookup_target_description
|
||||||
(const struct arc_gdbarch_features &features);
|
(const struct arc_arch_features &features);
|
||||||
|
|
||||||
#endif /* GDBSERVER */
|
#endif /* GDBSERVER */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue