Disassemble branch delay slot instructions automatically

Daniel Jacobowitz drow@false.org
Wed May 16 15:32:00 GMT 2007


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



More information about the Gdb-patches mailing list