disas: Fix printing of addresses in disassembly
commit636bd289398d203b2be5542279d24459767d6d4c
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 25 Jun 2012 04:55:55 +0000 (25 04:55 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 14 Jul 2012 10:32:34 +0000 (14 10:32 +0000)
tree7759b88da712b6f38fad80954478cacea0967316
parentfabaaf1d1f3f793999257cb16b509e32dfc1de71
disas: Fix printing of addresses in disassembly

In our disassembly code, the bfd_vma type is always 64 bits,
even if the target's virtual address width is only 32 bits. This
means that when we print out addresses we need to truncate them
to 32 bits, to avoid odd output which has incorrectly sign-extended
a value to 64 bits, for instance this ARM example:
    0x80479a60:  e59f4088     ldr  r4, [pc, #136]  ; 0xffffffff80479a4f

(It would also be possible to truncate before passing the address
to info->print_address_func(), but truncating in the final print
function is the same approach that binutils takes to this problem.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
disas.c