public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp
@ 2014-12-29  8:15 Yao Qi
  2014-12-29 23:20 ` Maciej W. Rozycki
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Qi @ 2014-12-29  8:15 UTC (permalink / raw)
  To: gdb-patches

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  <yao@codesourcery.com>

	* 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"
 }
-- 
1.9.3

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-08  3:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-29  8:15 [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp Yao Qi
2014-12-29 23:20 ` Maciej W. Rozycki
2014-12-30 12:34   ` Yao Qi
2014-12-30 14:17     ` Maciej W. Rozycki
2015-01-04  8:42       ` Yao Qi
2015-01-07 23:22         ` Maciej W. Rozycki
2015-01-08  1:10           ` Yao Qi
2015-01-08  1:24             ` Maciej W. Rozycki
2015-01-08  3:47               ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).