GDB (xrefs)
|
#include "defs.h"
#include <ctype.h>
#include "serial.h"
#include "gdb_string.h"
#include "gdbcmd.h"
#include "cli/cli-utils.h"
Go to the source code of this file.
#define SERIAL_BREAK 1235 |
Definition at line 64 of file serial.c.
Referenced by serial_logchar(), and serial_send_break().
void _initialize_serial | ( | void | ) |
static void do_serial_close | ( | struct serial * | scb, |
int | really_close | ||
) | [static] |
Definition at line 295 of file serial.c.
References serial::async_handler, serial::bufp, serial_ops::close, fputs_unfiltered(), serial::name, serial::next, serial::ops, serial_async(), serial_current_type, serial_unref(), ui_file_delete(), and xfree().
Referenced by serial_close(), and serial_un_fdopen().
void serial_add_interface | ( | struct serial_ops * | optable | ) |
Definition at line 159 of file serial.c.
References serial_ops::next, and serial_ops_list.
Referenced by _initialize_ser_dos(), and _initialize_ser_windows().
void serial_async | ( | struct serial * | scb, |
serial_event_ftype * | handler, | ||
void * | context | ||
) |
Definition at line 538 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 void serial_baud_show_cmd | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 632 of file serial.c.
References _, and fprintf_filtered().
int serial_can_async_p | ( | struct serial * | scb | ) |
Definition at line 526 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 338 of file serial.c.
References do_serial_close().
Referenced by close_ports(), m32r_close(), monitor_close(), monitor_open(), remote_close(), and remote_open_1().
serial_ttystate serial_copy_tty_state | ( | struct serial * | scb, |
serial_ttystate | ttystate | ||
) |
Definition at line 486 of file serial.c.
References serial_ops::copy_tty_state, and serial::ops.
Referenced by copy_terminal_info(), and terminal_init_inferior_with_pgrp().
void serial_debug | ( | struct serial * | scb, |
int | debug_p | ||
) |
Definition at line 552 of file serial.c.
References serial::debug_p.
int serial_debug_p | ( | struct serial * | scb | ) |
Definition at line 558 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 447 of file serial.c.
References serial_ops::drain_output, and serial::ops.
Referenced by print_flush().
struct serial* serial_fdopen | ( | const int | fd | ) | [read] |
Definition at line 289 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, |
struct serial_ops * | ops | ||
) | [static, read] |
Definition at line 249 of file serial.c.
References serial::async_context, serial::async_handler, serial::async_state, serial::buf, serial::bufcnt, serial::bufp, serial::debug_p, serial::error_fd, serial::fd, serial_ops::fdopen, serial::name, serial::next, serial::ops, serial::refcnt, scb_base, serial_interface_lookup(), and XCALLOC.
Referenced by serial_fdopen(), and serial_pipe().
int serial_flush_input | ( | struct serial * | scb | ) |
Definition at line 459 of file serial.c.
References serial_ops::flush_input, and serial::ops.
Referenced by load_srec(), monitor_open(), and remote_open_1().
int serial_flush_output | ( | struct serial * | scb | ) |
Definition at line 453 of file serial.c.
References serial_ops::flush_output, and serial::ops.
struct serial* serial_for_fd | ( | int | fd | ) | [read] |
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 480 of file serial.c.
References serial_ops::get_tty_state, and serial::ops.
Referenced by gdb_has_a_terminal(), terminal_ours_1(), and terminal_save_ours().
static struct serial_ops * serial_interface_lookup | ( | const char * | name | ) | [static, read] |
Definition at line 147 of file serial.c.
References serial_ops::name, and serial_ops::next.
Referenced by serial_fdopen_ops(), serial_open(), and serial_pipe().
int serial_is_async_p | ( | struct serial * | scb | ) |
Definition at line 532 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 350 of file serial.c.
References serial::bufp.
Referenced by run_async_handler_and_reschedule().
void serial_log_command | ( | const char * | cmd | ) |
Definition at line 130 of file serial.c.
References fputs_unfiltered(), gdb_flush(), and serial_current_type.
Referenced by _initialize_remote_mips(), init_base_monitor_ops(), init_m32r_ops(), and init_remote_ops().
static void serial_logchar | ( | struct ui_file * | stream, |
int | ch_type, | ||
int | ch, | ||
int | timeout | ||
) | [static] |
Definition at line 67 of file serial.c.
References fprintf_unfiltered(), fputc_unfiltered(), fputs_unfiltered(), logbase_ascii, logbase_hex, logbase_octal, 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().
int serial_noflush_set_tty_state | ( | struct serial * | scb, |
serial_ttystate | new_ttystate, | ||
serial_ttystate | old_ttystate | ||
) |
Definition at line 506 of file serial.c.
References serial_ops::noflush_set_tty_state, and serial::ops.
Referenced by terminal_ours_1().
struct serial* serial_open | ( | const char * | name | ) | [read] |
Definition at line 183 of file serial.c.
References serial::async_context, serial::async_handler, serial::async_state, serial::buf, serial::bufcnt, serial::bufp, serial::debug_p, serial::error_fd, gdb_fopen(), name, serial::name, serial::next, serial_ops::open, serial::ops, perror_with_name(), serial::refcnt, scb_base, serial_interface_lookup(), serial_logfile, skip_spaces_const(), strchr(), xfree(), and XMALLOC.
Referenced by m32r_open(), monitor_open(), and remote_serial_open().
int serial_pipe | ( | struct serial * | scbs[2] | ) |
Definition at line 585 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 498 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 433 of file serial.c.
References serial::buf, serial_write(), xfree(), and xstrvprintf().
void serial_raw | ( | struct serial * | scb | ) |
Definition at line 474 of file serial.c.
References serial_ops::go_raw, and serial::ops.
Referenced by monitor_open(), and remote_open_1().
int serial_readchar | ( | struct serial * | scb, |
int | timeout | ||
) |
Definition at line 370 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 get_ack(), m32r_insert_breakpoint(), m32r_wait(), m32r_xfer_memory(), mips_expect_timeout(), mips_readchar(), monitor_readchar(), pmon_check_ack(), readchar(), recv_data(), and sdistatus_command().
void serial_ref | ( | struct serial * | scb | ) |
Definition at line 356 of file serial.c.
References serial::refcnt.
Referenced by run_async_handler_and_reschedule().
int serial_send_break | ( | struct serial * | scb | ) |
Definition at line 465 of file serial.c.
References serial::ops, serial_ops::send_break, SERIAL_BREAK, and serial_logchar().
Referenced by mips_kill(), monitor_stop(), and send_interrupt_sequence().
static void serial_set_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 611 of file serial.c.
References gdb_stdout, help_list(), and printf_unfiltered().
int serial_set_tty_state | ( | struct serial * | scb, |
serial_ttystate | ttystate | ||
) |
Definition at line 492 of file serial.c.
References serial::ops, and serial_ops::set_tty_state.
Referenced by terminal_inferior().
int serial_setbaudrate | ( | struct serial * | scb, |
int | rate | ||
) |
Definition at line 514 of file serial.c.
References serial::ops, and serial_ops::setbaudrate.
Referenced by monitor_open(), and remote_open_1().
int serial_setstopbits | ( | struct serial * | scb, |
int | num | ||
) |
Definition at line 520 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 619 of file serial.c.
References cmd_show_list().
void serial_un_fdopen | ( | struct serial * | scb | ) |
void serial_unref | ( | struct serial * | scb | ) |
Definition at line 362 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 401 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 load_srec(), m32r_insert_breakpoint(), m32r_wait(), m32r_xfer_memory(), mips_kill(), mips_receive_packet(), monitor_read_memory(), monitor_write(), pmon_download(), remote_serial_write(), remote_start_remote(), send_data(), send_srec(), ser_tcp_send_break(), and serial_printf().
Definition at line 629 of file serial.c.
Referenced by captured_main(), monitor_files_info(), monitor_open(), and remote_open_1().
unsigned int global_serial_debug_p [static] |
Definition at line 31 of file serial.c.
Referenced by serial_debug_p().
const char logbase_ascii[] = "ascii" [static] |
Definition at line 52 of file serial.c.
Referenced by serial_logchar().
const char* const logbase_enums[] [static] |
{logbase_hex, logbase_octal, logbase_ascii, NULL}
const char logbase_hex[] = "hex" [static] |
Definition at line 50 of file serial.c.
Referenced by serial_logchar().
const char logbase_octal[] = "octal" [static] |
Definition at line 51 of file serial.c.
Referenced by serial_logchar().
Definition at line 39 of file serial.c.
Referenced by serial_fdopen_ops(), and serial_open().
int serial_current_type = 0 [static] |
Definition at line 58 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 55 of file serial.c.
Referenced by serial_logchar().
char* serial_logfile = NULL [static] |
Definition at line 44 of file serial.c.
Referenced by serial_open().
struct ui_file* serial_logfp = NULL [static] |
struct serial_ops* serial_ops_list = NULL [static] |
Definition at line 35 of file serial.c.
Referenced by serial_add_interface().
struct cmd_list_element* serial_set_cmdlist [static] |
struct cmd_list_element* serial_show_cmdlist [static] |