From b8676ff71c1069f80a690a5c42441948b46492bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E9=A6=99=E8=8F=9C=E8=81=94=E7=9B=9F?= Date: Thu, 27 Mar 2025 05:10:23 +0000 Subject: [PATCH] Fix loongarch linux_iterate_over_regset_sections wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 不吃香菜联盟 --- ...x_iterate_over_regset_sections-wrong.patch | 38 +++++++++++++++++++ gdb.spec | 9 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0004-Fix-loongarch_linux_iterate_over_regset_sections-wrong.patch diff --git a/0004-Fix-loongarch_linux_iterate_over_regset_sections-wrong.patch b/0004-Fix-loongarch_linux_iterate_over_regset_sections-wrong.patch new file mode 100644 index 0000000..24882d8 --- /dev/null +++ b/0004-Fix-loongarch_linux_iterate_over_regset_sections-wrong.patch @@ -0,0 +1,38 @@ +From 537325cc03efa65d090cdacfc8f7fffc6cc87bcd Mon Sep 17 00:00:00 2001 +From: niuwanli +Date: Thu, 27 Mar 2025 11:41:33 +0800 +Subject: [PATCH] Fix loongarch_linux_iterate_over_regset_sections wrong + +Signed-off-by: niuwanli +--- + gdb/loongarch-linux-tdep.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c +index 4268ac1..e78ee7c 100644 +--- a/gdb/loongarch-linux-tdep.c ++++ b/gdb/loongarch-linux-tdep.c +@@ -297,7 +297,7 @@ loongarch_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, + sizeof (loongarch_elf_gregset_t), &loongarch_elf_gregset, NULL, cb_data); + if (0 <= regs->f) + cb (".reg2", sizeof (loongarch_elf_fpregset_t), +- sizeof (loongarch_elf_gregset_t), &loongarch_elf_gregset, NULL, cb_data); ++ sizeof (loongarch_elf_fpregset_t), &loongarch_elf_fpregset, NULL, cb_data); + do + { + uint32_t t; +@@ -315,10 +315,10 @@ loongarch_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, + sizeof (loongarch_elf_lbtregset_t), &loongarch_elf_lbtregset, "Loongson Binary Translation", cb_data); + if (0 <= regs->vr) + cb (".reg-loongarch-lsx", sizeof (loongarch_elf_lsxregset_t), +-sizeof (loongarch_elf_lbtregset_t), &loongarch_elf_lsxregset, "Loongson SIMD Extension", cb_data); ++sizeof (loongarch_elf_lsxregset_t), &loongarch_elf_lsxregset, "Loongson SIMD Extension", cb_data); + if (0 <= regs->xr) + cb (".reg-loongarch-lasx", sizeof (loongarch_elf_lasxregset_t), +-sizeof (loongarch_elf_lbtregset_t), &loongarch_elf_lasxregset, "Loongson Advanced SIMD Extension", cb_data); ++sizeof (loongarch_elf_lasxregset_t), &loongarch_elf_lasxregset, "Loongson Advanced SIMD Extension", cb_data); + } + + static const struct target_desc * +-- +2.43.5 diff --git a/gdb.spec b/gdb.spec index 7c9fc49..91f601c 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.5 +%define anolis_release .0.6 # rpmbuild parameters: # --with testsuite: Run the testsuite (biarch if possible). Default is without. # --with buildisa: Use %%{?_isa} for BuildRequires @@ -218,6 +218,8 @@ Patch2004: 0003-Add-gdbserver-support-for-LoongArch.patch Patch2005: gdb-Dynamically-get-max-user-XSTATE-buffer-size.patch Patch2006: gdb-Disable-Wunused-function-partly-to-support-EMR-SPR-i.patch +Patch2007: 0004-Fix-loongarch_linux_iterate_over_regset_sections-wrong.patch + # Include the auto-generated file containing the "Patch:" directives. # See README.local-patches for more details. Patch9998: _gdb.spec.Patch.include @@ -517,6 +519,8 @@ done %patch2006 -p1 %endif +%patch2007 -p1 + # The above patches twiddle a .m4 file for configure, so update the affected # configure files pushd libiberty @@ -1207,6 +1211,9 @@ fi %endif %changelog +* Thu Mar 27 2025 niuwanli - 9.2-7.0.6 +- Fix loongarch linux_iterate_over_regset_sections wrong + * Tue Mar 12 2024 Zelin Deng - 9.2-7.0.5 - Dynamically get max user XSTATE buffer size to support SPR/EMR. -- Gitee