|
GDB (xrefs)
|
#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_ops * | serial_ops_p |
Functions | |
| 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_ops * | serial_interface_lookup (const char *name) |
| void | serial_add_interface (const struct serial_ops *optable) |
| struct serial * | serial_for_fd (int fd) |
| static struct serial * | new_serial (const struct serial_ops *ops) |
| static struct serial * | serial_open_ops_1 (const struct serial_ops *ops, const char *open_name) |
| struct serial * | serial_open (const char *name) |
| struct serial * | serial_open_ops (const struct serial_ops *ops) |
| static struct serial * | serial_fdopen_ops (const int fd, const struct serial_ops *ops) |
| struct serial * | serial_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_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 (const char *args, int from_tty) |
| static void | serial_show_cmd (const 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 (const char *ignore_args, int from_tty, struct cmd_list_element *c) |
| void | _initialize_serial (void) |
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_element * | serial_set_cmdlist |
| static struct cmd_list_element * | serial_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 |
| #define SERIAL_BREAK 1235 |
Definition at line 64 of file serial.c.
Referenced by serial_logchar(), and serial_send_break().
| typedef const struct serial_ops* serial_ops_p |
| void _initialize_serial | ( | void | ) |
Definition at line 674 of file serial.c.
References _, add_com(), add_prefix_cmd(), add_setshow_enum_cmd(), add_setshow_filename_cmd(), add_setshow_zinteger_cmd(), add_setshow_zuinteger_cmd(), baud_rate, class_maintenance, class_obscure, global_serial_debug_p, no_class, parity, parity_enums, serial_baud_show_cmd(), serial_logbase, serial_set_cmd(), serial_set_cmdlist, serial_show_cmd(), serial_show_cmdlist, set_parity(), setdebuglist, setlist, showdebuglist, and showlist.
| DEF_VEC_P | ( | serial_ops_p | ) |
|
static |
Definition at line 308 of file serial.c.
References serial::async_handler, serial::bufp, serial_ops::close, fputs_unfiltered(), serial::next, serial::ops, serial_async(), serial_current_type, and serial_unref().
Referenced by serial_close(), and serial_un_fdopen().
|
static |
Definition at line 183 of file serial.c.
References serial::buf, serial::bufp, serial::error_fd, serial::ops, serial::refcnt, and XCNEW.
Referenced by serial_fdopen_ops(), and serial_open_ops_1().
| void serial_add_interface | ( | const struct serial_ops * | optable | ) |
Definition at line 160 of file serial.c.
References VEC_safe_push.
Referenced by _initialize_ser_dos(), _initialize_ser_hardwire(), _initialize_ser_pipe(), _initialize_ser_tcp(), and _initialize_ser_windows().
| void serial_async | ( | struct serial * | scb, |
| serial_event_ftype * | handler, | ||
| void * | context | ||
| ) |
Definition at line 548 of file serial.c.
References serial_ops::async, serial::async_context, serial::async_handler, and serial::ops.
Referenced by do_serial_close(), and remote_async().
|
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 | ) |
Definition at line 348 of file serial.c.
References do_serial_close().
Referenced by remote_close(), and remote_open_1().
| serial_ttystate serial_copy_tty_state | ( | struct serial * | scb, |
| serial_ttystate | ttystate | ||
| ) |
Definition at line 496 of file serial.c.
References serial_ops::copy_tty_state, serial::ops, and serial::ttystate.
Referenced by child_terminal_init(), copy_terminal_info(), and set_initial_gdb_ttystate().
| 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 457 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 302 of file serial.c.
References serial::fd, and serial_fdopen_ops().
Referenced by initialize_stdin_serial(), and print_flush().
|
static |
Definition at line 274 of file serial.c.
References serial::fd, serial_ops::fdopen, new_serial(), serial::next, serial::ops, and serial_interface_lookup().
Referenced by serial_fdopen(), and serial_pipe().
| int serial_flush_input | ( | struct serial * | scb | ) |
Definition at line 469 of file serial.c.
References serial_ops::flush_input, and serial::ops.
Referenced by remote_open_1().
| int serial_flush_output | ( | struct serial * | scb | ) |
Definition at line 463 of file serial.c.
References serial_ops::flush_output, and serial::ops.
| struct serial* serial_for_fd | ( | int | fd | ) |
Definition at line 169 of file serial.c.
References serial::fd, and serial::next.
Referenced by gdb_select().
| serial_ttystate serial_get_tty_state | ( | struct serial * | scb | ) |
Definition at line 490 of file serial.c.
References serial_ops::get_tty_state, and serial::ops.
Referenced by child_terminal_ours_1(), gdb_save_tty_state(), and set_initial_gdb_ttystate().
|
static |
Definition at line 147 of file serial.c.
References name, 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(), ser_base_read_error_fd(), and serial_readchar().
| int serial_is_open | ( | struct serial * | scb | ) |
Definition at line 360 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 | ||
| ) |
Definition at line 130 of file serial.c.
References fputs_unfiltered(), gdb_flush(), and serial_current_type.
Referenced by init_remote_ops().
|
static |
Definition at line 67 of file serial.c.
References fprintf_unfiltered(), fputc_unfiltered(), fputs_unfiltered(), safe_strerror(), SERIAL_BREAK, serial_current_type, SERIAL_EOF, SERIAL_ERROR, serial_logbase, and SERIAL_TIMEOUT.
Referenced by serial_readchar(), serial_send_break(), and serial_write().
| struct serial* serial_open | ( | const char * | name | ) |
Definition at line 204 of file serial.c.
References name, serial_interface_lookup(), serial_open_ops_1(), skip_spaces(), and startswith().
Referenced by remote_serial_open().
| struct serial* serial_open_ops | ( | const struct serial_ops * | ops | ) |
Definition at line 265 of file serial.c.
References serial::ops, and serial_open_ops_1().
Referenced by make_serial_event().
|
static |
Definition at line 233 of file serial.c.
References new_serial(), serial::next, serial_ops::open, serial::ops, perror_with_name(), and xfree().
Referenced by serial_open(), and serial_open_ops().
| 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().
| void serial_print_tty_state | ( | struct serial * | scb, |
| serial_ttystate | ttystate, | ||
| struct ui_file * | stream | ||
| ) |
Definition at line 508 of file serial.c.
References serial::ops, serial_ops::print_tty_state, and serial::ttystate.
Referenced by child_terminal_info().
| void serial_printf | ( | struct serial * | desc, |
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 443 of file serial.c.
References serial::buf, serial_write(), xfree(), and xstrvprintf().
| void serial_raw | ( | struct serial * | scb | ) |
Definition at line 484 of file serial.c.
References serial_ops::go_raw, and serial::ops.
Referenced by remote_open_1().
| int serial_readchar | ( | struct serial * | scb, |
| int | timeout | ||
| ) |
Definition at line 380 of file serial.c.
References _, fprintf_unfiltered(), gdb_flush(), gdb_stdlog, internal_error(), serial::ops, serial_ops::readchar, serial_debug_p(), serial_is_async_p(), and serial_logchar().
Referenced by readchar().
| void serial_ref | ( | struct serial * | scb | ) |
Definition at line 366 of file serial.c.
References serial::refcnt.
Referenced by run_async_handler_and_reschedule().
| int serial_send_break | ( | struct serial * | scb | ) |
Definition at line 475 of file serial.c.
References serial::ops, serial_ops::send_break, SERIAL_BREAK, and serial_logchar().
Referenced by send_interrupt_sequence().
|
static |
Definition at line 621 of file serial.c.
References all_commands, gdb_stdout, help_list(), printf_unfiltered(), and serial_set_cmdlist.
Referenced by _initialize_serial().
| int serial_set_tty_state | ( | struct serial * | scb, |
| serial_ttystate | ttystate | ||
| ) |
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().
| int serial_setbaudrate | ( | struct serial * | scb, |
| int | rate | ||
| ) |
Definition at line 516 of file serial.c.
References serial::ops, rate, and serial_ops::setbaudrate.
Referenced by remote_open_1().
| int serial_setparity | ( | struct serial * | scb, |
| int | parity | ||
| ) |
Definition at line 530 of file serial.c.
References serial::ops, parity, and serial_ops::setparity.
Referenced by 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.
|
static |
Definition at line 629 of file serial.c.
References cmd_show_list(), and serial_show_cmdlist.
Referenced by _initialize_serial().
| void serial_un_fdopen | ( | struct serial * | scb | ) |
| void serial_unref | ( | struct serial * | scb | ) |
Definition at line 372 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 | ||
| ) |
Definition at line 411 of file serial.c.
References serial::buf, fprintf_unfiltered(), gdb_flush(), gdb_stdlog, serial::ops, serial_debug_p(), serial_logchar(), and serial_ops::write.
Referenced by remote_serial_write(), ser_tcp_send_break(), and serial_printf().
|
static |
Definition at line 663 of file serial.c.
References GDBPARITY_EVEN, GDBPARITY_NONE, GDBPARITY_ODD, parity, parity_even, parity_odd, and serial_parity.
Referenced by _initialize_serial().
| VEC | ( | serial_ops_p | ) |
| int baud_rate = -1 |
Definition at line 639 of file serial.c.
Referenced by _initialize_serial(), captured_main_1(), and remote_open_1().
|
static |
Definition at line 28 of file serial.c.
Referenced by _initialize_serial(), and serial_debug_p().
|
static |
Definition at line 658 of file serial.c.
Referenced by _initialize_serial(), hardwire_setparity(), ser_windows_setparity(), serial_setparity(), and set_parity().
|
static |
|
static |
Definition at line 655 of file serial.c.
Referenced by set_parity().
|
static |
Definition at line 654 of file serial.c.
Referenced by set_parity().
|
static |
Definition at line 58 of file serial.c.
Referenced by do_serial_close(), serial_log_command(), and serial_logchar().
|
static |
Definition at line 55 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 remote_open_1(), and set_parity().
|
static |
Definition at line 617 of file serial.c.
Referenced by _initialize_serial(), and serial_set_cmd().
|
static |
Definition at line 618 of file serial.c.
Referenced by _initialize_serial(), and serial_show_cmd().
1.8.14