remote-sim.c: cleanup debug output code.
Manually tested with a --target=arm-eabi build, and doing
$ arm-eabi-gcc ~/gdb/tests/main.c -o a.out -c -g
$ ./gdb a.out
...
(gdb) tar sim
(gdb) load
(gdb) set debug remote 1
(gdb) disassemble 0
Dump of assembler code for function main:
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x0, len 4, write 0
0x00000000 <+0>: 0xe1a0c00d
mov r12, sp
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x4, len 4, write 0
0x00000004 <+4>: 0xe92dd800
push {r11, r12, lr, pc}
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x8, len 4, write 0
0x00000008 <+8>: 0xe24cb004
sub r11, r12, #4
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0xc, len 4, write 0
0x0000000c <+12>: 0xe24dd008
sub sp, sp, #8
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x10, len 4, write 0
0x00000010 <+16>: 0xe50b0010
str r0, [r11, #-16]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x14, len 4, write 0
0x00000014 <+20>: 0xe50b1014
str r1, [r11, #-20]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x18, len 4, write 0
0x00000018 <+24>: 0xe3a03000
mov r3, #0
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x1c, len 4, write 0
0x0000001c <+28>: 0xe1a00003
mov r0, r3
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x20, len 4, write 0
0x00000020 <+32>: 0xe24bd00c
sub sp, r11, #12
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x24, len 4, write 0
0x00000024 <+36>: 0xe89da800
ldm sp, {r11, sp, pc}
End of assembler dump.
(gdb) p *0 = 1
gdbsim_xfer_inferior_memory: myaddr 0xc69bc0, memaddr 0x0, len 4, write 1
0x00000001
$1 = 1
Which happens to differ from before, I think due to stdout line buffering:
(gdb) disassemble 0
Dump of assembler code for function main:
0x00000000 <+0>: gdbsim_xfer_inferior_memory: myaddr 0x0x7fffffffd400, memaddr 0x0, len 4, write 0
0xe1a0c00d
But the new output looks reasonable to me, better even.
gdb/
2013-09-06 Pedro Alves <palves@redhat.com>
* remote-sim.c (gdbsim_xfer_inferior_memory): Use
host_address_to_string, and send debug output to gdb_stdlog.