This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Disassemble branch delay slot instructions automatically
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: gdb-patches at sourceware dot org, Nigel Stephens <nigel at mips dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Wed, 16 May 2007 11:32:42 -0400
- Subject: Re: Disassemble branch delay slot instructions automatically
- References: <Pine.LNX.4.61.0705151913050.31736@perivale.mips.com>
On Tue, May 15, 2007 at 07:13:41PM +0100, Maciej W. Rozycki wrote:
> Hello,
>
> This is a change that implements automatic disassembly of instructions in
> a branch delay slot if a branch is the last instruction to be output. It
> is especially useful with the "display /i" command when single-stepping,
> where you may want to see a single instruction normally not to get
> distracted, but with a branch an intruction that follows would be executed
> without having been printed.
>
> Here is an example for MIPS machine code -- this is with our current
> implementation:
>
> (gdb) x /i 0x801018a4
> 0x801018a4 <pthread_create+52>: beqz v0,0x80101a10 <pthread_create+416>
>
> and here -- the same command with the patch applied:
>
> (gdb) x /i 0x801018a4
> 0x801018a4 <pthread_create+52>: beqz v0,0x80101a10 <pthread_create+416>
> 0x801018a8 <pthread_create+56>: li v1,11
>
> This change has been tested natively for mips-unknown-linux-gnu and
> remotely for mipsisa32-sde-elf, using mips-sim-sde32/-EB and
> mips-sim-sde32/-EL as the targets, with no regressions.
I would like additional opinions on this patch.
My first reaction was "hey, that would be useful to me", but my second
was concern that this would upset a GDB/MI frontend. We should at
least try to provoke a problem in one such frontend first.
--
Daniel Jacobowitz
CodeSourcery