GDB (xrefs)
|
#include "defs.h"
#include "serial.h"
#include "ser-base.h"
#include "gdbsupport/event-loop.h"
#include "gdbsupport/gdb_select.h"
#include "gdbsupport/gdb_sys_time.h"
Go to the source code of this file.
Enumerations | |
enum | { FD_SCHEDULED = -1 , NOTHING_SCHEDULED = -2 } |
Functions | |
static void | reschedule (struct serial *scb) |
static void | run_async_handler_and_reschedule (struct serial *scb) |
static void | fd_event (int error, void *context) |
static void | push_event (void *context) |
static int | ser_base_wait_for (struct serial *scb, int timeout) |
static void | ser_base_read_error_fd (struct serial *scb, int close_fd) |
static void | handle_error_fd (int error, gdb_client_data client_data) |
static int | do_ser_base_readchar (struct serial *scb, int timeout) |
int | generic_readchar (struct serial *scb, int timeout, int(do_readchar)(struct serial *scb, int timeout)) |
int | ser_base_readchar (struct serial *scb, int timeout) |
int | ser_base_write (struct serial *scb, const void *buf, size_t count) |
int | ser_base_flush_output (struct serial *scb) |
int | ser_base_flush_input (struct serial *scb) |
int | ser_base_send_break (struct serial *scb) |
int | ser_base_drain_output (struct serial *scb) |
void | ser_base_raw (struct serial *scb) |
serial_ttystate | ser_base_get_tty_state (struct serial *scb) |
serial_ttystate | ser_base_copy_tty_state (struct serial *scb, serial_ttystate ttystate) |
int | ser_base_set_tty_state (struct serial *scb, serial_ttystate ttystate) |
void | ser_base_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *stream) |
int | ser_base_setbaudrate (struct serial *scb, int rate) |
int | ser_base_setstopbits (struct serial *scb, int num) |
int | ser_base_setparity (struct serial *scb, int parity) |
void | ser_base_async (struct serial *scb, int async_p) |
Variables | |
static timer_handler_func | push_event |
static handler_func | fd_event |
anonymous enum |
Enumerator | |
---|---|
FD_SCHEDULED | |
NOTHING_SCHEDULED |
Definition at line 45 of file ser-base.c.
|
static |
Definition at line 337 of file ser-base.c.
References serial::buf, serial::bufcnt, serial::bufp, deprecated_ui_loop_hook, serial::ops, serial_ops::read_prim, ser_base_read_error_fd(), ser_base_wait_for(), SERIAL_EOF, SERIAL_ERROR, SERIAL_TIMEOUT, and status.
Referenced by ser_base_readchar().
|
static |
Definition at line 155 of file ser-base.c.
References serial::buf, serial::bufcnt, serial::bufp, serial::ops, serial_ops::read_prim, run_async_handler_and_reschedule(), SERIAL_EOF, and SERIAL_ERROR.
int generic_readchar | ( | struct serial * | scb, |
int | timeout, | ||
int(do_readchar)(struct serial *scb, int timeout) | ) |
Definition at line 427 of file ser-base.c.
References serial::bufcnt, serial::bufp, reschedule(), ser_base_read_error_fd(), SERIAL_EOF, SERIAL_ERROR, and SERIAL_TIMEOUT.
Referenced by ser_base_readchar().
|
static |
Definition at line 323 of file ser-base.c.
References ser_base_read_error_fd().
Referenced by ser_base_async().
|
static |
Definition at line 198 of file ser-base.c.
References serial::async_state, NOTHING_SCHEDULED, and run_async_handler_and_reschedule().
|
static |
Definition at line 66 of file ser-base.c.
References serial::async_state, serial::bufcnt, serial::fd, fd_event, FD_SCHEDULED, gdb_printf(), gdb_stdlog, NOTHING_SCHEDULED, push_event, serial_debug_p(), and serial_is_async_p().
Referenced by generic_readchar(), run_async_handler_and_reschedule(), and ser_base_async().
|
static |
Definition at line 129 of file ser-base.c.
References serial::async_context, serial::async_handler, reschedule(), serial_is_open(), serial_ref(), and serial_unref().
Referenced by fd_event(), and push_event().
void ser_base_async | ( | struct serial * | scb, |
int | async_p ) |
Definition at line 587 of file ser-base.c.
References serial::async_state, serial::error_fd, serial::fd, FD_SCHEDULED, gdb_printf(), gdb_stdlog, handle_error_fd(), NOTHING_SCHEDULED, reschedule(), and serial_debug_p().
serial_ttystate ser_base_copy_tty_state | ( | struct serial * | scb, |
serial_ttystate | ttystate ) |
Definition at line 543 of file ser-base.c.
int ser_base_drain_output | ( | struct serial * | scb | ) |
Definition at line 524 of file ser-base.c.
int ser_base_flush_input | ( | struct serial * | scb | ) |
Definition at line 505 of file ser-base.c.
References serial::buf, serial::bufcnt, serial::bufp, and SERIAL_ERROR.
Referenced by hardwire_flush_input().
int ser_base_flush_output | ( | struct serial * | scb | ) |
Definition at line 499 of file ser-base.c.
serial_ttystate ser_base_get_tty_state | ( | struct serial * | scb | ) |
Definition at line 536 of file ser-base.c.
void ser_base_print_tty_state | ( | struct serial * | scb, |
serial_ttystate | ttystate, | ||
struct ui_file * | stream ) |
Definition at line 556 of file ser-base.c.
void ser_base_raw | ( | struct serial * | scb | ) |
Definition at line 530 of file ser-base.c.
|
static |
Definition at line 262 of file ser-base.c.
References serial_ops::avail, serial::error_fd, GDB_MI_MSG_WIDTH, gdb_puts(), gdb_stderr, serial::ops, read(), and serial_is_async_p().
Referenced by do_ser_base_readchar(), generic_readchar(), and handle_error_fd().
int ser_base_readchar | ( | struct serial * | scb, |
int | timeout ) |
Definition at line 469 of file ser-base.c.
References do_ser_base_readchar(), and generic_readchar().
int ser_base_send_break | ( | struct serial * | scb | ) |
Definition at line 518 of file ser-base.c.
int ser_base_set_tty_state | ( | struct serial * | scb, |
serial_ttystate | ttystate ) |
Definition at line 550 of file ser-base.c.
int ser_base_setbaudrate | ( | struct serial * | scb, |
int | rate ) |
Definition at line 565 of file ser-base.c.
int ser_base_setparity | ( | struct serial * | scb, |
int | parity ) |
Definition at line 579 of file ser-base.c.
int ser_base_setstopbits | ( | struct serial * | scb, |
int | num ) |
Definition at line 571 of file ser-base.c.
|
static |
Definition at line 215 of file ser-base.c.
References serial::fd, interruptible_select(), QUIT, SERIAL_ERROR, and SERIAL_TIMEOUT.
Referenced by do_ser_base_readchar().
int ser_base_write | ( | struct serial * | scb, |
const void * | buf, | ||
size_t | count ) |
Definition at line 475 of file ser-base.c.
References serial::ops, QUIT, and serial_ops::write_prim.
|
static |
Definition at line 33 of file ser-base.c.
Referenced by reschedule().
|
static |
Definition at line 32 of file ser-base.c.
Referenced by reschedule().