From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7873) id B30D83858D28; Thu, 21 Mar 2024 14:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B30D83858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711030122; bh=E36b0mTGHVwY/y9tWohrErqM2jpcCE+6wWRBN9DWpvU=; h=From:To:Subject:Date:From; b=jayhE3P+SsFZPQAvXk+czUST6kSrxa6uhqVCI1Vy5ej0sTAV2t827f7HEUZGdrskt lQkXoTRHla9VBi72kOV5vOxFB2FenmQ2j9ECttt33ROcl2zd2Ah9dQlMmG3lNLvB27 3c0Ov85HQFECL2SHeFHOOmfEDPZ/+3/xAOKPK/u4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tiezhu Yang To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: LoongArch: Silence warning about core file of lsx and lasx X-Act-Checkin: binutils-gdb X-Git-Author: Hui Li X-Git-Refname: refs/heads/master X-Git-Oldrev: b7b293fa3bccbe0b450a859f71c2a90517902719 X-Git-Newrev: 006efc27dc52e4093ccee2dd5d4867c6a7f13fd6 Message-Id: <20240321140842.B30D83858D28@sourceware.org> Date: Thu, 21 Mar 2024 14:08:42 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D006efc27dc52= e4093ccee2dd5d4867c6a7f13fd6 commit 006efc27dc52e4093ccee2dd5d4867c6a7f13fd6 Author: Hui Li Date: Thu Mar 21 09:41:30 2024 +0800 gdb: LoongArch: Silence warning about core file of lsx and lasx =20 In loongarch_iterate_over_regset_sections(), the second and third argum= ents of the iterate_over_regset_sections_cb callback function should be the = regset size which is regsize * regnum. Otherwise when execute: =20 make check-gdb TESTS=3D"gdb.base/corefile.exp" =20 there exists the following failed log: =20 (gdb) core-file /home/fedora/community/gdb/build/gdb/testsuite/output= s/gdb.base/corefile/corefile.core [New LWP 531099] warning: Unexpected size of section `.reg-loongarch-lsx/531099' in co= re file. warning: Unexpected size of section `.reg-loongarch-lasx/531099' in c= ore file. Core was generated by `/home/fedora/community/gdb/build/gdb/testsuite= /outputs/gdb.base/corefile/corefile'. Program terminated with signal SIGABRT, Aborted. warning: Unexpected size of section `.reg-loongarch-lsx/531099' in co= re file. warning: Unexpected size of section `.reg-loongarch-lasx/531099' in c= ore file. #0 0x00007ffff3081600 in __pthread_kill_implementation.constprop.0 (= ) from /lib64/libc.so.6 (gdb) FAIL: gdb.base/corefile.exp: core-file warning-free =20 Signed-off-by: Hui Li Signed-off-by: Tiezhu Yang Diff: --- gdb/loongarch-linux-tdep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c index 1c7a7cf222c..db6371eb556 100644 --- a/gdb/loongarch-linux-tdep.c +++ b/gdb/loongarch-linux-tdep.c @@ -498,7 +498,9 @@ loongarch_iterate_over_regset_sections (struct gdbarch = *gdbarch, int fpsize =3D fprsize * LOONGARCH_LINUX_NUM_FPREGSET + fccsize * LOONGARCH_LINUX_NUM_FCC + fcsrsize; int lsxrsize =3D register_size (gdbarch, LOONGARCH_FIRST_LSX_REGNUM); + int lsxsize =3D lsxrsize * LOONGARCH_LINUX_NUM_LSXREGSET; int lasxrsize =3D register_size (gdbarch, LOONGARCH_FIRST_LASX_REGNUM); + int lasxsize =3D lasxrsize * LOONGARCH_LINUX_NUM_LASXREGSET; int scrsize =3D register_size (gdbarch, LOONGARCH_FIRST_SCR_REGNUM); int eflagssize =3D register_size (gdbarch, LOONGARCH_EFLAGS_REGNUM); int ftopsize =3D register_size (gdbarch, LOONGARCH_FTOP_REGNUM); @@ -507,9 +509,9 @@ loongarch_iterate_over_regset_sections (struct gdbarch = *gdbarch, cb (".reg", LOONGARCH_LINUX_NUM_GREGSET * gprsize, LOONGARCH_LINUX_NUM_GREGSET * gprsize, &loongarch_gregset, nullptr, = cb_data); cb (".reg2", fpsize, fpsize, &loongarch_fpregset, nullptr, cb_data); - cb (".reg-loongarch-lsx", lsxrsize, lsxrsize, + cb (".reg-loongarch-lsx", lsxsize, lsxsize, &loongarch_lsxregset, nullptr, cb_data); - cb (".reg-loongarch-lasx", lasxrsize, lasxrsize, + cb (".reg-loongarch-lasx", lasxsize, lasxsize, &loongarch_lasxregset, nullptr, cb_data); cb (".reg-loongarch-lbt", lbtsize, lbtsize, &loongarch_lbtregset, nullptr, cb_data);