gdb_byte for binary buffer, char for string: remote.c, tracepoint.c.
authorPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:27:06 +0000 (15:27 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:27:06 +0000 (15:27 +0000)
commitbc20a4afc3fa41cab07aa68571b713ecef0aa675
tree241fb2ef1f6c8643a0af164ddf4df0490e9134d9
parentc628b528e091211bd746e5c9b18b5bc7298d01f3
gdb_byte for binary buffer, char for string: remote.c, tracepoint.c.

While the RSP is largely ASCII based (hence the packet buffer type is
char *), at places we pass around 8-bit binary packets in that buffer.
Functions like hex2bin or remote_escape_output conceptually are
handling binary buffers, so I left them as working with gdb_byte, and
added casts where necessary.  Whether these are host bytes or target
bytes is blurry at present, so this is largely a matter of taste.
Switching some of these functions to take "char *" or "void *" would
be equally good.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

* remote.c (remote_write_bytes_aux, compare_sections_command)
(remote_read_qxfer)
(remote_search_memory, remote_hostio_pwrite, remote_hostio_pread)
(remote_hostio_readlink, remote_bfd_iovec_pread)
(remote_set_trace_notes): Use gdb_byte when RSP buffer is used as
binary buffer, and char when buffer is used as string.
* tracepoint.c (encode_source_string, tfile_write_uploaded_tp)
(trace_save, tfile_open, traceframe_walk_blocks)
(tfile_fetch_registers): Likewise.
gdb/ChangeLog
gdb/remote.c
gdb/tracepoint.c