go32-nat.c: Don't install a deprecated_xfer_memory method
authorPedro Alves <palves@redhat.com>
Wed, 26 Feb 2014 14:36:04 +0000 (14:36 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 26 Feb 2014 14:38:31 +0000 (14:38 +0000)
commitbd265cd0bde9e045ab5946532449430b66fe91ad
tree69a81354fc7d48853e7feb88e8a75f34eb6bf0de
parent9d46c4e5f55d67542036c87ca4d63078cedbaee2
go32-nat.c: Don't install a deprecated_xfer_memory method

This removes yet another instance of a deprecated_xfer_memory user.

Unfortunately djgpp's write_child function takes a non-const buffer
pointer, while GDB's xfer_partial api passes a const pointer.  To be
const-correct, we need to copy that buffer to a non-const buffer, and
pass the copy to write_child.  This is actually what
target.c:default_xfer_partial itself does, when calling into the
ops->deprecated_xfer_memory hook.

Tested by cross-building djgpp gdb, on x86-64 Fedora 17.

gdb/
2014-02-26  Pedro Alves  <palves@redhat.com>

* go32-nat.c (my_write_child): New function.
(go32_xfer_memory): Rewrite as to_xfer_partial helper.
(go32_xfer_partial): New function.
(init_go32_ops): Don't install a deprecated_xfer_memory hook.
Instead install a to_xfer_partial hook.
gdb/ChangeLog
gdb/go32-nat.c