From 12863263d6f610ec161aead53df89586787b2ce4 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 11 Jul 2018 08:34:50 +0100 Subject: [PATCH] Rename tdesc_register_size to tdesc_register_bitsize tdesc_register_size returns number of bits, not bytes. Rename to make it clearer. Also, fixed bug in aarch64_get_tdesc_vq which assumed bytes. gdb/ * target-descriptions.c (tdesc_register_bitsize): Rename. * target-descriptions.h (tdesc_register_bitsize): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Use new name. * aarch64-tdep.c (aarch64_get_tdesc_vq): Convert size. --- gdb/ChangeLog | 7 +++++++ gdb/aarch64-tdep.c | 4 ++-- gdb/rs6000-tdep.c | 4 ++-- gdb/target-descriptions.c | 3 +-- gdb/target-descriptions.h | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1de7230b07c..7c74c87d8c5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-07-11 Alan Hayward + + * target-descriptions.c (tdesc_register_bitsize): Rename. + * target-descriptions.h (tdesc_register_bitsize): Likewise. + * rs6000-tdep.c (rs6000_gdbarch_init): Use new name. + * aarch64-tdep.c (aarch64_get_tdesc_vq): Convert size. + 2018-07-10 Tom Tromey * breakpoint.c (moribund_locations): Now static and a diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 5120fffe776..5c6eb985451 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2922,8 +2922,8 @@ aarch64_get_tdesc_vq (const struct target_desc *tdesc) if (feature_sve == nullptr) return 0; - uint64_t vl = tdesc_register_size (feature_sve, - aarch64_sve_register_names[0]); + uint64_t vl = tdesc_register_bitsize (feature_sve, + aarch64_sve_register_names[0]) / 8; return sve_vq_from_vl (vl); } diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 4eeb62ac52f..45bf98267a9 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -5953,7 +5953,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) have_mq = tdesc_numbered_register (feature, tdesc_data, PPC_MQ_REGNUM, "mq"); - tdesc_wordsize = tdesc_register_size (feature, "pc") / 8; + tdesc_wordsize = tdesc_register_bitsize (feature, "pc") / 8; if (wordsize == -1) wordsize = tdesc_wordsize; @@ -5984,7 +5984,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* The fpscr register was expanded in isa 2.05 to 64 bits along with the addition of the decimal floating point facility. */ - if (tdesc_register_size (feature, "fpscr") > 32) + if (tdesc_register_bitsize (feature, "fpscr") > 32) have_dfp = 1; } else diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 3d7aa2582e7..a96416cd3cc 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -816,8 +816,7 @@ tdesc_numbered_register_choices (const struct tdesc_feature *feature, bits. The register must exist. */ int -tdesc_register_size (const struct tdesc_feature *feature, - const char *name) +tdesc_register_bitsize (const struct tdesc_feature *feature, const char *name) { struct tdesc_reg *reg = tdesc_find_register_early (feature, name); diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index 3ba71b1add6..87403acc0d4 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -125,8 +125,8 @@ int tdesc_unnumbered_register (const struct tdesc_feature *feature, /* Search FEATURE for a register named NAME, and return its size in bits. The register must exist. */ -int tdesc_register_size (const struct tdesc_feature *feature, - const char *name); +int tdesc_register_bitsize (const struct tdesc_feature *feature, + const char *name); /* Search FEATURE for a register with any of the names from NAMES (NULL-terminated). Record REGNO and the register in DATA; when -- 2.30.2