From patchwork Mon Dec 29 08:14:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 4452 Received: (qmail 21943 invoked by alias); 29 Dec 2014 08:15:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 21930 invoked by uid 89); 29 Dec 2014 08:15:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Dec 2014 08:15:10 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1Y5VTn-0003p5-Oq from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 29 Dec 2014 00:15:07 -0800 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Mon, 29 Dec 2014 00:15:07 -0800 From: Yao Qi To: Subject: [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp Date: Mon, 29 Dec 2014 16:14:21 +0800 Message-ID: <1419840861-10723-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes The test entry-values.exp doesn't recognize the call instruction "jal" on MIPS, so this patch sets call_insn "jal" first. Currently, we assume the next instruction address of call instruction is the address returned from foo, however it is not correct on MIPS which has delay slot. We extend variable call_insn to match one instruction after jal, so that $returned_from_foo is correct on MIPS. All tests in entry-values.exp are PASS. gdb/testsuite: 2014-12-29 Yao Qi * gdb.trace/entry-values.exp: Set call_insn for MIPS target. --- gdb/testsuite/gdb.trace/entry-values.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp index 6bb0514..bf395f7 100644 --- a/gdb/testsuite/gdb.trace/entry-values.exp +++ b/gdb/testsuite/gdb.trace/entry-values.exp @@ -43,6 +43,16 @@ if { [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] } { set call_insn "brasl" } elseif { [istarget "powerpc*-*-*"] } { set call_insn "bl" +} elseif { [istarget "mips*-*-*"] } { + # Skip one instruction after jal which is the delay slot. + # + # jal foo + # insn1 + # insn2 + # + # program goes to insn2 when it returns from foo. We should set + # RETURNED_FROM_FOO to insn2. + set call_insn "jal\[^\r\n\]+\r\n" } else { set call_insn "call" }