This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Disassembly difference
- To: Gerwyn Davies <gerwynd at tommoll dot freeserve dot co dot uk>
- Subject: Re: Disassembly difference
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 08 Aug 2000 17:01:35 -0700
- CC: GDB <gdb at sourceware dot cygnus dot com>
- References: <008101bffd2f$8db67b20$1701883e@gtd-s-machine>
Gerwyn Davies wrote:
>
> Hello,
>
> I'm experiencing a difference in opinion between the disassembly produced by
> objdump and that produced by GDB. As these two traces show. Can anyone offer
> an explanation.
GDB would be using a different dissassembler to objdump - most likely it
is selecting the default mips3 (?) dissassembler where as objdump will
have selected the tx39 variant. Look for how tm_print_insn is being
(incorrectly?) set.
Andrew
>
> GDB TRACE:
> This GDB was configured as "--host=i586-pc-cygwin32 --target=mips-tx39-elf".
> (gdb) target remote com1
> Remote debugging using com1
> 0xbfc09fbc in ?? ()
> (gdb) load led.rom
> Loading section .text, size 0xe34 lma 0xa0008000
> Loading section .ctors, size 0x8 lma 0xa0020e34
> Loading section .dtors, size 0x8 lma 0xa0020e3c
> Loading section .data, size 0x720 lma 0xa0008e34
> Loading section .sdata, size 0x1c lma 0xa0009554
> Start address 0xa0020000 , load size 5504
> Transfer rate: 1693 bits/sec.
> (gdb) disas 0xa0020000 0xa0020030
> Dump of assembler code from 0xa0020000 to 0xa0020030:
> 0xa0020000: nop
> 0xa0020004: sllv $zero,$zero,$zero
> 0xa0020008: 0x2010000
> 0xa002000c: lb $zero,512($a0)
> 0xa0020010: nop
> 0xa0020014: nop
> 0xa0020018: sll $zero,$s0,0x0
> 0xa002001c: 0x1
> 0xa0020020: 0x10a001
> 0xa0020024: nop
> 0xa0020028: sll $zero,$zero,0x8
> 0xa002002c: nop
> End of assembler dump.
>
> OBJDUMP TRACE:
> 00000000a0020000 <_start>:
> a0020000: 00000000 nop
>
> 00000000a0020004 <zerobss>:
> a0020004: 3c02a004 lui $v0,0xa004
> a0020008: 2442073c addiu $v0,$v0,1852
> a002000c: 3c03a004 lui $v1,0xa004
> a0020010: 24630850 addiu $v1,$v1,2128
> a0020014: ac400000 sw $zero,0($v0)
> a0020018: 24420004 addiu $v0,$v0,4
> a002001c: 0062082b sltu $at,$v1,$v0
> a0020020: 1020fffc beqz $at,a0020014 <zerobss+0x10>
> ...