diff options
author | Jiangshuai Li <jiangshuai_li@linux.alibaba.com> | 2022-11-09 19:50:35 +0800 |
---|---|---|
committer | Jiangshuai Li <jiangshuai_li@linux.alibaba.com> | 2022-11-21 09:55:49 +0800 |
commit | 84f9fbe90e5429adb9dee68f04f44c92fa9e2345 (patch) | |
tree | 65feb68e0e3fc7a3e9a676b868ca1986c5cd89a7 | |
parent | e710dfe0cf3be7cd87ba397ffa6c74706d8ecbfb (diff) | |
download | gdb-84f9fbe90e5429adb9dee68f04f44c92fa9e2345.zip gdb-84f9fbe90e5429adb9dee68f04f44c92fa9e2345.tar.gz gdb-84f9fbe90e5429adb9dee68f04f44c92fa9e2345.tar.bz2 |
gdb/csky just return type from csky_vector_type() for vector resgisters
Some gdb stubs may not describe the type for vector registers in the
tdesc-xml and only send bitsize="128", gdb can't deal with a reg
with default type int with bitsize==128. So Just return csky_vector_type()
for vector resgisters.
-rw-r--r-- | gdb/csky-tdep.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index ced1b03..f293d20 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -711,6 +711,13 @@ csky_register_type (struct gdbarch *gdbarch, int reg_nr) return builtin_type (gdbarch)->builtin_int32; } + /* Vector register has 128 bits, and only in ck810. Just return + csky_vector_type(), not check tdesc_has_registers(), is in case + of some GDB stub does not describe type for Vector resgisters + in the target-description-xml. */ + if ((reg_nr >= CSKY_VR0_REGNUM) && (reg_nr <= CSKY_VR0_REGNUM + 15)) + return csky_vector_type (gdbarch); + /* If type has been described in tdesc-xml, use it. */ if (tdesc_has_registers (gdbarch_target_desc (gdbarch))) { @@ -733,10 +740,6 @@ csky_register_type (struct gdbarch *gdbarch, int reg_nr) return arch_float_type (gdbarch, 64, "builtin_type_csky_ext", floatformats_ieee_double); - /* Vector register has 128 bits, and only in ck810. */ - if ((reg_nr >= CSKY_VR0_REGNUM) && (reg_nr <= CSKY_VR0_REGNUM + 15)) - return csky_vector_type (gdbarch); - /* Profiling general register has 48 bits, we use 64bit. */ if ((reg_nr >= CSKY_PROFGR_REGNUM) && (reg_nr <= CSKY_PROFGR_REGNUM + 44)) return builtin_type (gdbarch)->builtin_uint64; |