From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 1562B3858D33; Tue, 10 May 2022 21:09:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1562B3858D33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Maciej W. Rozycki To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: mips: Fix large-frame.exp test case failure X-Act-Checkin: binutils-gdb X-Git-Author: Youling Tang X-Git-Refname: refs/heads/master X-Git-Oldrev: 2c3c88db125df810ff0209d4a1fbc49161b3d9cf X-Git-Newrev: f8b786e2eddbbad9e9aa724038feb1ffcf7b2bd9 Message-Id: <20220510210905.1562B3858D33@sourceware.org> Date: Tue, 10 May 2022 21:09:05 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 21:09:05 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df8b786e2eddb= bad9e9aa724038feb1ffcf7b2bd9 commit f8b786e2eddbbad9e9aa724038feb1ffcf7b2bd9 Author: Youling Tang Date: Tue May 10 22:07:04 2022 +0100 gdb: mips: Fix large-frame.exp test case failure =20 $ objdump -d outputs/gdb.base/large-frame/large-frame-O2 0000000120000b20 : 120000b20: 67bdbff0 daddiu sp,sp,-16400 120000b24: ffbc4000 sd gp,16384(sp) 120000b28: 3c1c0002 lui gp,0x2 120000b2c: 679c8210 daddiu gp,gp,-32240 120000b30: 0399e02d daddu gp,gp,t9 120000b34: df998058 ld t9,-32680(gp) 120000b38: ffbf4008 sd ra,16392(sp) 120000b3c: 0411ffd8 bal 120000aa0 ... =20 The disassembly of the above func function shows that we may use instructions such as daddiu/daddu, so add "daddiu $gp,$gp,n", "daddu $gp,$gp,$t9" and "daddu $gp,$t9,$gp" to the mips32_scan_prologue function to fix the large-frame.exp test case. =20 Before applying the patch: =20 backtrace #0 blah (a=3D0xfffffee220) at .../gdb/testsuite/gdb.base/large-frame-= 1.c:24 #1 0x0000000120000b44 in func () Backtrace stopped: frame did not save the PC (gdb) FAIL: gdb.base/large-frame.exp: optimize=3D-O2: backtrace =20 # of expected passes 5 # of unexpected failures 1 =20 After applying the patch: =20 # of expected passes 6 =20 Signed-off-by: Youling Tang Diff: --- gdb/mips-tdep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index ffed8723dce..805c5beba59 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -3588,8 +3588,11 @@ restart: || (inst & 0xFF9F07FF) =3D=3D 0x00800021 /* move reg,$a0-$a3 */ || high_word =3D=3D 0x3c1c /* lui $gp,n */ || high_word =3D=3D 0x279c /* addiu $gp,$gp,n */ + || high_word =3D=3D 0x679c /* daddiu $gp,$gp,n */ || inst =3D=3D 0x0399e021 /* addu $gp,$gp,$t9 */ || inst =3D=3D 0x033ce021 /* addu $gp,$t9,$gp */ + || inst =3D=3D 0x0399e02d /* daddu $gp,$gp,$t9 */ + || inst =3D=3D 0x033ce02d /* daddu $gp,$t9,$gp */ ) { /* These instructions are part of the prologue, but we don't