This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 29 Dec 2014 23:20:39 +0000
- Subject: Re: [PATCH] Recognize branch instruction on MIPS in gdb.trace/entry-values.exp
- Authentication-results: sourceware.org; auth=none
- References: <1419840861-10723-1-git-send-email-yao at codesourcery dot com>
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