This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/22286] [MIPS] internal-error when read dspctl register


https://sourceware.org/bugzilla/show_bug.cgi?id=22286

--- Comment #1 from Paul Hua <paul.hua.gm at gmail dot com> ---

In mips64-dsp-linux.c:102

102   tdesc_create_reg (feature, "dspctl", 78, 1, NULL, 32, "int");

define the reg size is '32'。

but in inf-ptrace.c:
734   size = register_size (gdbarch, regnum);
735   gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);

the PTRACE_TYPE_RET is long, sizeof (PTRACE_TYPE_RET) is 8, size is 4, so
triger the gdb_assert.

we should define dspctl size is 64, like status/cause register.

Changelog:

2017-10-12  Chenghua Xu  <paul.hua.gm@gmail.com>

        * mips64-dsp-linux.c (initialize_tdesc_mips64_dsp_linux): Change
          dspctl from 32 to 64 bit.


-----------------------------------------------------------------------

diff --git a/gdb/features/mips64-dsp-linux.c b/gdb/features/mips64-dsp-linux.c
index 05317b7..b42a8ce 100644
--- a/gdb/features/mips64-dsp-linux.c
+++ b/gdb/features/mips64-dsp-linux.c
@@ -99,7 +99,7 @@ initialize_tdesc_mips64_dsp_linux (void)
   tdesc_create_reg (feature, "lo2", 75, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "hi3", 76, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "lo3", 77, 1, NULL, 64, "int");
-  tdesc_create_reg (feature, "dspctl", 78, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "dspctl", 78, 1, NULL, 64, "int");

   feature = tdesc_create_feature (result, "org.gnu.gdb.mips.linux");
   tdesc_create_reg (feature, "restart", 79, 1, "system", 64, "int");

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]