GDB (xrefs)
Macros | Typedefs | Functions | Variables
/tmp/gdb-7.10/gdb/serial.c File Reference
#include "defs.h"
#include <ctype.h>
#include "serial.h"
#include "gdbcmd.h"
#include "cli/cli-utils.h"

Go to the source code of this file.

Macros

#define SERIAL_BREAK   1235
 

Typedefs

typedef const struct serial_opsserial_ops_p
 

Functions

void _initialize_serial (void)
 
 DEF_VEC_P (serial_ops_p)
 
 VEC (serial_ops_p)
 
static void serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout)
 
void serial_log_command (struct target_ops *self, const char *cmd)
 
static const struct serial_opsserial_interface_lookup (const char *name)
 
void serial_add_interface (const struct serial_ops *optable)
 
struct serialserial_for_fd (int fd)
 
struct serialserial_open (const char *name)
 
static struct serialserial_fdopen_ops (const int fd, const struct serial_ops *ops)
 
struct serialserial_fdopen (const int fd)
 
static void do_serial_close (struct serial *scb, int really_close)
 
void serial_close (struct serial *scb)
 
void serial_un_fdopen (struct serial *scb)
 
int serial_is_open (struct serial *scb)
 
void serial_ref (struct serial *scb)
 
void serial_unref (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 *format,...)
 
int serial_drain_output (struct serial *scb)
 
int serial_flush_output (struct serial *scb)
 
int serial_flush_input (struct serial *scb)
 
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 *stream)
 
int serial_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate)
 
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)
 
int serial_pipe (struct serial *scbs[2])
 
static void serial_set_cmd (char *args, int from_tty)
 
static void serial_show_cmd (char *args, int from_tty)
 
static void serial_baud_show_cmd (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void set_parity (char *ignore_args, int from_tty, struct cmd_list_element *c)
 

Variables

static unsigned int global_serial_debug_p
 
static const char * serial_logbase = logbase_ascii
 
static int serial_current_type = 0
 
static struct cmd_list_elementserial_set_cmdlist
 
static struct cmd_list_elementserial_show_cmdlist
 
int baud_rate = -1
 
int serial_parity = GDBPARITY_NONE
 
static const char parity_none [] = "none"
 
static const char parity_odd [] = "odd"
 
static const char parity_even [] = "even"
 
static const char *const parity_enums []
 
static const char * parity = parity_none
 

Macro Definition Documentation

#define SERIAL_BREAK   1235

Definition at line 66 of file serial.c.

Referenced by serial_logchar(), and serial_send_break().

Typedef Documentation

typedef const struct serial_ops* serial_ops_p

Definition at line 32 of file serial.c.

Function Documentation

void _initialize_serial ( void  )
DEF_VEC_P ( serial_ops_p  )
static void do_serial_close ( struct serial scb,
int  really_close 
)
static
void serial_add_interface ( const struct serial_ops optable)
void serial_async ( struct serial scb,
serial_event_ftype handler,
void *  context 
)
static void serial_baud_show_cmd ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 642 of file serial.c.

References _, and fprintf_filtered().

Referenced by _initialize_serial().

int serial_can_async_p ( struct serial scb)

Definition at line 536 of file serial.c.

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

Referenced by remote_can_async_p().

void serial_close ( struct serial scb)
serial_ttystate serial_copy_tty_state ( struct serial scb,
serial_ttystate  ttystate 
)

Definition at line 488 of file serial.c.

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

Referenced by child_terminal_init_with_pgrp(), and copy_terminal_info().

void serial_debug ( struct serial scb,
int  debug_p 
)

Definition at line 562 of file serial.c.

References serial::debug_p.

int serial_debug_p ( struct serial scb)

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().

int serial_drain_output ( struct serial scb)

Definition at line 449 of file serial.c.

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

Referenced by print_flush().

struct serial* serial_fdopen ( const int  fd)

Definition at line 291 of file serial.c.

References serial_fdopen_ops().

Referenced by initialize_stdin_serial(), and print_flush().

static struct serial* serial_fdopen_ops ( const int  fd,
const struct serial_ops ops 
)
static
int serial_flush_input ( struct serial scb)
int serial_flush_output ( struct serial scb)

Definition at line 455 of file serial.c.

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

Referenced by mips_initialize().

struct serial* serial_for_fd ( int  fd)

Definition at line 171 of file serial.c.

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

Referenced by gdb_select().

serial_ttystate serial_get_tty_state ( struct serial scb)
static const struct serial_ops* serial_interface_lookup ( const char *  name)
static

Definition at line 149 of file serial.c.

References serial_ops::name, and VEC_iterate.

Referenced by serial_fdopen_ops(), serial_open(), and serial_pipe().

int serial_is_async_p ( struct serial scb)

Definition at line 542 of file serial.c.

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

Referenced by remote_is_async_p(), reschedule(), and serial_readchar().

int serial_is_open ( struct serial scb)

Definition at line 352 of file serial.c.

References serial::bufp.

Referenced by run_async_handler_and_reschedule().

void serial_log_command ( struct target_ops self,
const char *  cmd 
)
static void serial_logchar ( struct ui_file stream,
int  ch_type,
int  ch,
int  timeout 
)
static
int serial_noflush_set_tty_state ( struct serial scb,
serial_ttystate  new_ttystate,
serial_ttystate  old_ttystate 
)

Definition at line 508 of file serial.c.

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

Referenced by child_terminal_ours_1().

struct serial* serial_open ( const char *  name)
int serial_pipe ( struct serial scbs[2])

Definition at line 595 of file serial.c.

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

Referenced by gdbpy_initialize_events().

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

Definition at line 500 of file serial.c.

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

Referenced by child_terminal_info().

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

Definition at line 435 of file serial.c.

References serial::buf, serial_write(), xfree(), and xstrvprintf().

void serial_raw ( struct serial scb)

Definition at line 476 of file serial.c.

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

Referenced by common_open(), monitor_open(), and remote_open_1().

int serial_readchar ( struct serial scb,
int  timeout 
)
void serial_ref ( struct serial scb)

Definition at line 358 of file serial.c.

References serial::refcnt.

Referenced by run_async_handler_and_reschedule().

int serial_send_break ( struct serial scb)
static void serial_set_cmd ( char *  args,
int  from_tty 
)
static

Definition at line 621 of file serial.c.

References all_commands, gdb_stdout, help_list(), and printf_unfiltered().

Referenced by _initialize_serial().

int serial_set_tty_state ( struct serial scb,
serial_ttystate  ttystate 
)

Definition at line 494 of file serial.c.

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

Referenced by child_terminal_inferior().

int serial_setbaudrate ( struct serial scb,
int  rate 
)

Definition at line 516 of file serial.c.

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

Referenced by common_open(), monitor_open(), and remote_open_1().

int serial_setparity ( struct serial scb,
int  parity 
)

Definition at line 530 of file serial.c.

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

Referenced by monitor_open(), and remote_open_1().

int serial_setstopbits ( struct serial scb,
int  num 
)

Definition at line 522 of file serial.c.

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

Referenced by monitor_open().

static void serial_show_cmd ( char *  args,
int  from_tty 
)
static

Definition at line 629 of file serial.c.

References cmd_show_list().

Referenced by _initialize_serial().

void serial_un_fdopen ( struct serial scb)

Definition at line 346 of file serial.c.

References do_serial_close().

Referenced by print_flush().

void serial_unref ( struct serial scb)

Definition at line 364 of file serial.c.

References serial::refcnt, and xfree().

Referenced by do_serial_close(), and run_async_handler_and_reschedule().

int serial_write ( struct serial scb,
const void *  buf,
size_t  count 
)
static void set_parity ( char *  ignore_args,
int  from_tty,
struct cmd_list_element c 
)
static

Definition at line 663 of file serial.c.

References GDBPARITY_EVEN, GDBPARITY_NONE, and GDBPARITY_ODD.

Referenced by _initialize_serial().

VEC ( serial_ops_p  )

Definition at line 37 of file serial.c.

Variable Documentation

int baud_rate = -1

Definition at line 639 of file serial.c.

Referenced by captured_main(), common_open(), monitor_files_info(), monitor_open(), and remote_open_1().

unsigned int global_serial_debug_p
static

Definition at line 30 of file serial.c.

Referenced by _initialize_serial(), and serial_debug_p().

const char* parity = parity_none
static

Definition at line 658 of file serial.c.

const char* const parity_enums[]
static
Initial value:
=
static const char parity_even[]
Definition: serial.c:655
static const char parity_none[]
Definition: serial.c:653
static const char parity_odd[]
Definition: serial.c:654

Definition at line 656 of file serial.c.

const char parity_even[] = "even"
static

Definition at line 655 of file serial.c.

const char parity_none[] = "none"
static

Definition at line 653 of file serial.c.

const char parity_odd[] = "odd"
static

Definition at line 654 of file serial.c.

int serial_current_type = 0
static

Definition at line 60 of file serial.c.

Referenced by do_serial_close(), serial_log_command(), and serial_logchar().

const char* serial_logbase = logbase_ascii
static

Definition at line 57 of file serial.c.

Referenced by _initialize_serial(), and serial_logchar().

int serial_parity = GDBPARITY_NONE

Definition at line 651 of file serial.c.

Referenced by monitor_open(), and remote_open_1().

struct cmd_list_element* serial_set_cmdlist
static

Definition at line 617 of file serial.c.

struct cmd_list_element* serial_show_cmdlist
static

Definition at line 618 of file serial.c.