Re: [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp

Maciej W. Rozycki
2014-12-29T23:20:53Z

On Mon, 29 Dec 2014, Yao Qi wrote:

> 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.

What's the semantics of the test case and the changes you're making?

I'm asking because the MIPS architecture has several instructions used to
make procedure calls, depending on the ISA and ABI selected, and also
compiler options. Besides JAL these instructions include JALS, JALX,
JALR, JALRC, JALRS, BAL and BALS. It looks to me you need to modify the
pattern here to take these into account; JALRC does not have a delay slot.

> All tests in entry-values.exp are PASS.

Which target and ABI(s) did you ran your testing on? Please try at least
these: o32/MIPS, o32/MIPS16, o32/microMIPS, n64 on a Linux and a
bare-metal target each; testing o32/MIPS16 with the `-mflip-mips16' GCC
option too will be appreciated. These combinations should trigger some
(although not all) of the other possible instructions.

Maciej