aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/utils.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-08-27 16:02:49 +0000
committerPedro Alves <palves@redhat.com>2010-08-27 16:02:49 +0000
commitec48365dd86cceb7bfc5e1c9ba9a68b01600abf3 (patch)
treebf4fec06abd18ba90bea2538ac30ae46dcc031d9 /gdb/gdbserver/utils.c
parentf383de6633cba5ef363eabb486005f1cdb1270f7 (diff)
downloadgdb-ec48365dd86cceb7bfc5e1c9ba9a68b01600abf3.zip
gdb-ec48365dd86cceb7bfc5e1c9ba9a68b01600abf3.tar.gz
gdb-ec48365dd86cceb7bfc5e1c9ba9a68b01600abf3.tar.bz2
* event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
(struct gdb_event) <fd>: Change type to gdb_fildes_t. (struct file_handler) <fd>: Change type to gdb_fildes_t. (process_event): Change local fd's type to gdb_fildes_t. (create_file_handler): Adjust prototype. (delete_file_handler): Adjust prototype. (handle_file_event): Adjust prototype. Use pfildes. (create_file_event): Adjsut prototype. * remote-utils.c (remote_desc, listen_desc): Change type to gdb_fildes_t. * server.h: New gdb_fildes_t typedef. [USE_WIN32API]: Include winsock2.h. (delete_file_handler, add_file_handler): Adjust prototypes. (pfildes): Declare. * utils.c (pfildes): New.
Diffstat (limited to 'gdb/gdbserver/utils.c')
-rw-r--r--gdb/gdbserver/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 8a1acd9..4c047e0 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -370,3 +370,15 @@ paddress (CORE_ADDR addr)
{
return phex_nz (addr, sizeof (CORE_ADDR));
}
+
+/* Convert a file descriptor into a printable string. */
+
+char *
+pfildes (gdb_fildes_t fd)
+{
+#if USE_WIN32API
+ return phex_nz (fd, sizeof (gdb_fildes_t));
+#else
+ return plongest (fd);
+#endif
+}