GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
serial.h File Reference

Go to the source code of this file.

Classes

struct  serial
 
struct  serial_ops
 

Macros

#define SERIAL_1_STOPBITS   1
 
#define SERIAL_1_AND_A_HALF_STOPBITS   2 /* 1.5 bits, snicker... */
 
#define SERIAL_2_STOPBITS   3
 
#define GDBPARITY_NONE   0
 
#define GDBPARITY_ODD   1
 
#define GDBPARITY_EVEN   2
 

Typedefs

typedef void * serial_ttystate
 
typedef void serial_event_ftype(struct serial *scb, void *context)
 

Enumerations

enum  serial_rc { SERIAL_ERROR = -1 , SERIAL_TIMEOUT = -2 , SERIAL_EOF = -3 }
 

Functions

struct serialserial_open (const char *name)
 
struct serialserial_open_ops (const struct serial_ops *ops)
 
int serial_is_open (struct serial *scb)
 
struct serialserial_for_fd (int fd)
 
struct serialserial_fdopen (const int fd)
 
void serial_close (struct serial *scb)
 
void serial_ref (struct serial *scb)
 
void serial_unref (struct serial *scb)
 
int gdb_pipe (int fildes[2])
 
int serial_pipe (struct serial *scbs[2])
 
void serial_un_fdopen (struct serial *scb)
 
int serial_readchar (struct serial *scb, int timeout)
 
int serial_write (struct serial *scb, const void *buf, size_t count)
 
void serial_printf (struct serial *desc, const char *,...) ATTRIBUTE_PRINTF(2
 
void int serial_drain_output (struct serial *)
 
int serial_flush_output (struct serial *)
 
int serial_flush_input (struct serial *)
 
int serial_send_break (struct serial *scb)
 
void serial_raw (struct serial *scb)
 
serial_ttystate serial_get_tty_state (struct serial *scb)
 
serial_ttystate serial_copy_tty_state (struct serial *scb, serial_ttystate ttystate)
 
int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 
void serial_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *)
 
int serial_setbaudrate (struct serial *scb, int rate)
 
int serial_setstopbits (struct serial *scb, int num)
 
int serial_setparity (struct serial *scb, int parity)
 
int serial_can_async_p (struct serial *scb)
 
int serial_is_async_p (struct serial *scb)
 
void serial_async (struct serial *scb, serial_event_ftype *handler, void *context)
 
void serial_debug (struct serial *scb, int debug_p)
 
int serial_debug_p (struct serial *scb)
 
void serial_add_interface (const struct serial_ops *optable)
 
void serial_log_command (struct target_ops *self, const char *)
 

Variables

int baud_rate
 
int serial_parity
 

Macro Definition Documentation

◆ GDBPARITY_EVEN

#define GDBPARITY_EVEN   2

Definition at line 196 of file serial.h.

Referenced by hardwire_setparity(), ser_windows_setparity(), and set_parity().

◆ GDBPARITY_NONE

#define GDBPARITY_NONE   0

Definition at line 194 of file serial.h.

Referenced by hardwire_setparity(), ser_windows_setparity(), and set_parity().

◆ GDBPARITY_ODD

#define GDBPARITY_ODD   1

Definition at line 195 of file serial.h.

Referenced by hardwire_setparity(), ser_windows_setparity(), and set_parity().

◆ SERIAL_1_AND_A_HALF_STOPBITS

#define SERIAL_1_AND_A_HALF_STOPBITS   2 /* 1.5 bits, snicker... */

Definition at line 189 of file serial.h.

Referenced by dos_setstopbits(), hardwire_setstopbits(), and ser_windows_setstopbits().

◆ SERIAL_1_STOPBITS

#define SERIAL_1_STOPBITS   1

Definition at line 188 of file serial.h.

Referenced by dos_setstopbits(), hardwire_setstopbits(), and ser_windows_setstopbits().

◆ SERIAL_2_STOPBITS

#define SERIAL_2_STOPBITS   3

Definition at line 190 of file serial.h.

Referenced by dos_setstopbits(), hardwire_setstopbits(), and ser_windows_setstopbits().

Typedef Documentation

◆ serial_event_ftype

typedef void serial_event_ftype(struct serial *scb, void *context)

Definition at line 216 of file serial.h.

◆ serial_ttystate

typedef void* serial_ttystate

Definition at line 35 of file serial.h.

Enumeration Type Documentation

◆ serial_rc

enum serial_rc
Enumerator
SERIAL_ERROR 
SERIAL_TIMEOUT 
SERIAL_EOF 

Definition at line 109 of file serial.h.

Function Documentation

◆ gdb_pipe()

int gdb_pipe ( int fildes[2])
extern

Definition at line 882 of file ser-go32.c.

Referenced by serial_pipe().

◆ serial_add_interface()

void serial_add_interface ( const struct serial_ops * optable)
extern

Definition at line 154 of file serial.c.

References serial_ops_list.

Referenced by _initialize_ser_dos(), and _initialize_ser_windows().

◆ serial_async()

void serial_async ( struct serial * scb,
serial_event_ftype * handler,
void * context )
extern

◆ serial_can_async_p()

int serial_can_async_p ( struct serial * scb)
extern

Definition at line 536 of file serial.c.

References serial_ops::async, and serial::ops.

Referenced by remote_target::can_async_p().

◆ serial_close()

void serial_close ( struct serial * scb)
extern

Definition at line 351 of file serial.c.

References do_serial_close().

Referenced by remote_target::open_1().

◆ serial_copy_tty_state()

serial_ttystate serial_copy_tty_state ( struct serial * scb,
serial_ttystate ttystate )
extern

◆ serial_debug()

void serial_debug ( struct serial * scb,
int debug_p )
extern

Definition at line 562 of file serial.c.

References serial::debug_p.

◆ serial_debug_p()

int serial_debug_p ( struct serial * scb)
extern

Definition at line 568 of file serial.c.

References serial::debug_p, and global_serial_debug_p.

Referenced by reschedule(), ser_base_async(), serial_readchar(), and serial_write().

◆ serial_drain_output()

void int serial_drain_output ( struct serial * scb)
extern

Definition at line 457 of file serial.c.

References serial_ops::drain_output, and serial::ops.

Referenced by print_flush().

◆ serial_fdopen()

struct serial * serial_fdopen ( const int fd)
extern

Definition at line 303 of file serial.c.

References serial::fd, and serial_fdopen_ops().

Referenced by initialize_stdin_serial(), and print_flush().

◆ serial_flush_input()

int serial_flush_input ( struct serial * scb)
extern

Definition at line 469 of file serial.c.

References serial_ops::flush_input, and serial::ops.

Referenced by remote_target::open_1().

◆ serial_flush_output()

int serial_flush_output ( struct serial * scb)
extern

Definition at line 463 of file serial.c.

References serial_ops::flush_output, and serial::ops.

◆ serial_for_fd()

struct serial * serial_for_fd ( int fd)
extern

Definition at line 163 of file serial.c.

References serial::fd, serial::next, and scb_base.

Referenced by gdb_select().

◆ serial_get_tty_state()

serial_ttystate serial_get_tty_state ( struct serial * scb)
extern

◆ serial_is_async_p()

int serial_is_async_p ( struct serial * scb)
extern

◆ serial_is_open()

int serial_is_open ( struct serial * scb)
extern

Definition at line 363 of file serial.c.

References serial::bufp.

Referenced by run_async_handler_and_reschedule().

◆ serial_log_command()

void serial_log_command ( struct target_ops * self,
const char * cmd )
extern

Definition at line 127 of file serial.c.

References gdb_flush(), gdb_puts(), serial_current_type, and serial_logfp.

Referenced by remote_target::log_command().

◆ serial_open()

struct serial * serial_open ( const char * name)
extern

Definition at line 198 of file serial.c.

References name, serial_interface_lookup(), and serial_open_ops_1().

Referenced by remote_serial_open().

◆ serial_open_ops()

struct serial * serial_open_ops ( const struct serial_ops * ops)
extern

Definition at line 265 of file serial.c.

References serial::ops, and serial_open_ops_1().

Referenced by make_serial_event().

◆ serial_pipe()

int serial_pipe ( struct serial * scbs[2])
extern

Definition at line 595 of file serial.c.

References gdb_pipe(), serial_fdopen_ops(), and serial_interface_lookup().

◆ serial_print_tty_state()

void serial_print_tty_state ( struct serial * scb,
serial_ttystate ttystate,
struct ui_file * stream )
extern

Definition at line 508 of file serial.c.

References serial::ops, serial_ops::print_tty_state, and serial::ttystate.

Referenced by child_terminal_info().

◆ serial_printf()

void serial_printf ( struct serial * desc,
const char * ,
... )
extern

◆ serial_raw()

void serial_raw ( struct serial * scb)
extern

Definition at line 484 of file serial.c.

References serial_ops::go_raw, and serial::ops.

Referenced by remote_target::open_1().

◆ serial_readchar()

int serial_readchar ( struct serial * scb,
int timeout )
extern

◆ serial_ref()

void serial_ref ( struct serial * scb)
extern

Definition at line 369 of file serial.c.

References serial::refcnt.

Referenced by run_async_handler_and_reschedule().

◆ serial_send_break()

int serial_send_break ( struct serial * scb)
extern

◆ serial_set_tty_state()

int serial_set_tty_state ( struct serial * scb,
serial_ttystate ttystate )
extern

Definition at line 502 of file serial.c.

References serial::ops, serial_ops::set_tty_state, and serial::ttystate.

Referenced by child_terminal_inferior(), and child_terminal_ours_1().

◆ serial_setbaudrate()

int serial_setbaudrate ( struct serial * scb,
int rate )
extern

Definition at line 516 of file serial.c.

References serial::ops, rate, and serial_ops::setbaudrate.

Referenced by remote_target::open_1().

◆ serial_setparity()

int serial_setparity ( struct serial * scb,
int parity )
extern

Definition at line 530 of file serial.c.

References serial::ops, parity, and serial_ops::setparity.

Referenced by remote_target::open_1().

◆ serial_setstopbits()

int serial_setstopbits ( struct serial * scb,
int num )
extern

Definition at line 522 of file serial.c.

References serial::ops, and serial_ops::setstopbits.

◆ serial_un_fdopen()

void serial_un_fdopen ( struct serial * scb)
extern

Definition at line 357 of file serial.c.

References do_serial_close().

Referenced by print_flush().

◆ serial_unref()

void serial_unref ( struct serial * scb)
extern

Definition at line 375 of file serial.c.

References serial::refcnt, and xfree().

Referenced by do_serial_close(), and run_async_handler_and_reschedule().

◆ serial_write()

int serial_write ( struct serial * scb,
const void * buf,
size_t count )
extern

Variable Documentation

◆ baud_rate

int baud_rate
extern

Definition at line 622 of file serial.c.

Referenced by captured_main_1(), and remote_target::open_1().

◆ serial_parity

int serial_parity
extern

Definition at line 634 of file serial.c.

Referenced by remote_target::open_1(), and set_parity().