This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: mips-tdep.c: Adjust breakpoints in branch delay slots
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: macro at mips dot com
- Cc: gdb-patches at sourceware dot org, chris at mips dot com, macro at linux-mips dot org
- Date: Thu, 24 May 2007 20:21:05 +0200 (CEST)
- Subject: Re: mips-tdep.c: Adjust breakpoints in branch delay slots
- References: <Pine.LNX.4.61.0705241853450.21951@perivale.mips.com>
> Date: Thu, 24 May 2007 19:07:46 +0100 (BST)
> From: "Maciej W. Rozycki" <macro@mips.com>
>
> Hello,
>
> This is a change that makes breakpoints requested in a branch or jump
> delay slot be moved to the preceding instruction. This removes a
> confusion that arises when such a breakpoint is hit and the resulting
> message like this:
>
> (gdb) break *0x00400670
> Breakpoint 1 at 0x400670: file foo.c, line 12.
> (gdb) run
> Starting program: .../foo
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> main (argc=1, argv=0x7fd7c874) at foo.c:12
> 12 }
> (gdb) x /2i $pc
> 0x40066c <main+12>: jr ra
> 0x400670 <main+16>: move v0,zero
>
> This change has been tested natively for mips-unknown-linux-gnu and
> remotely for mipsisa32-sde-elf, using mips-sim-sde32/-EB,
> mips-sim-sde32/-mips16/-EB, mips-sim-sde32/-EL and
> mips-sim-sde32/-mips16/-EL as the targets, with no regressions.
>
> 2007-05-24 Chris Dearman <chris@mips.com>
> Maciej W. Rozycki <macro@mips.com>
>
> * mips-tdep.c (mips32_instruction_has_delay_slot): New function.
> (mips16_instruction_has_delay_slot): Likewise.
> (mips_segment_boundary): Likewise.
> (mips_adjust_breakpoint_address): Likewise.
> (mips_gdbarch_init): Use mips_adjust_breakpoint_address.
>
> OK to apply?
Do we have a testcase for this? I also would like to test this on
OpenBSD/mips64. Unfortunately I won't be able to test this in the
next three weeks. Can this wait until then?