156 struct serial *scb = context;
161 else if (scb->
bufcnt == 0)
193 struct serial *scb = context;
209 fd_set readfds, exceptfds;
219 FD_ZERO (&exceptfds);
220 FD_SET (scb->
fd, &readfds);
221 FD_SET (scb->
fd, &exceptfds);
224 numfds =
gdb_select (scb->
fd + 1, &readfds, 0, &exceptfds, &tv);
226 numfds =
gdb_select (scb->
fd + 1, &readfds, 0, &exceptfds, 0);
232 else if (errno == EINTR)
264 to_read = (num_bytes < to_read) ? num_bytes : to_read;
270 if ((s == -1) || (s == 0 && !close_fd))
273 if (s == 0 && close_fd)
288 while ((newline = strstr (current,
"\n")) != NULL)
293 current = newline + 1;
319 delta = (timeout == 0 ? 0 : 1);
346 else if (timeout == 0)
394 int (do_readchar) (
struct serial *scb,
int timeout))
410 ch = do_readchar (scb, timeout);
443 const char *str = buf;
ssize_t read(int fd, void *buf, size_t count)
int serial_is_async_p(struct serial *scb)
void( timer_handler_func)(gdb_client_data)
int generic_readchar(struct serial *scb, int timeout, int(do_readchar)(struct serial *scb, int timeout))
serial_event_ftype * async_handler
int ser_base_set_tty_state(struct serial *scb, serial_ttystate ttystate)
void fputs_unfiltered(const char *buf, struct ui_file *file)
int ser_base_flush_output(struct serial *scb)
static timer_handler_func push_event
int ser_base_setbaudrate(struct serial *scb, int rate)
int ser_base_setstopbits(struct serial *scb, int num)
static void reschedule(struct serial *scb)
int(* read_prim)(struct serial *scb, size_t count)
int serial_debug_p(struct serial *scb)
void add_file_handler(int fd, handler_func *proc, gdb_client_data client_data)
static void ser_base_read_error_fd(struct serial *scb, int close_fd)
void ser_base_raw(struct serial *scb)
void ser_base_async(struct serial *scb, int async_p)
void serial_unref(struct serial *scb)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
int ser_base_noflush_set_tty_state(struct serial *scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate)
int(* write_prim)(struct serial *scb, const void *buf, size_t count)
static handler_func fd_event
static const char * parity
int gdb_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
int ser_base_drain_output(struct serial *scb)
unsigned char buf[BUFSIZ]
struct ui_file * gdb_stdlog
void( handler_func)(int, gdb_client_data)
void ser_base_print_tty_state(struct serial *scb, serial_ttystate ttystate, struct ui_file *stream)
int create_timer(int milliseconds, timer_handler_func *proc, gdb_client_data client_data)
int ser_base_setparity(struct serial *scb, int parity)
int(* avail)(struct serial *scb, int fd)
struct ui_file * gdb_stderr
int ser_base_flush_input(struct serial *scb)
int ser_base_readchar(struct serial *scb, int timeout)
int ser_base_send_break(struct serial *scb)
int ser_base_write(struct serial *scb, const void *buf, size_t count)
void delete_timer(int id)
static void run_async_handler_and_reschedule(struct serial *scb)
void serial_ref(struct serial *scb)
serial_ttystate ser_base_copy_tty_state(struct serial *scb, serial_ttystate ttystate)
int serial_is_open(struct serial *scb)
static int do_ser_base_readchar(struct serial *scb, int timeout)
const struct serial_ops * ops
void error(const char *fmt,...)
void delete_file_handler(int fd)
static int ser_base_wait_for(struct serial *scb, int timeout)
int(* deprecated_ui_loop_hook)(int signo)
serial_ttystate ser_base_get_tty_state(struct serial *scb)