GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/ser-tcp.c File Reference
`#include "defs.h"`
`#include "serial.h"`
`#include "ser-base.h"`
`#include "ser-tcp.h"`
`#include "gdbcmd.h"`
`#include "cli/cli-decode.h"`
`#include "cli/cli-setshow.h"`
`#include "filestuff.h"`
`#include <sys/types.h>`
`#include <sys/ioctl.h>`
`#include "gdb_sys_time.h"`
`#include <netinet/in.h>`
`#include <arpa/inet.h>`
`#include <netdb.h>`
`#include <sys/socket.h>`
`#include <netinet/tcp.h>`
`#include <signal.h>`
`#include "gdb_select.h"`
`#include <algorithm>`

Go to the source code of this file.

## Macros
#define | POLL_INTERVAL 5

## Functions
static int | wait_for_connect (struct serial *scb, unsigned int *polls)
int | net_open (struct serial *scb, const char *name)
void | net_close (struct serial *scb)
int | net_read_prim (struct serial *scb, size_t count)
int | net_write_prim (struct serial *scb, const void *buf, size_t count)
int | ser_tcp_send_break (struct serial *scb)
static void | set_tcp_cmd (const char *args, int from_tty)
static void | show_tcp_cmd (const char *args, int from_tty)
void | _initialize_ser_tcp (void)

## Variables
static struct cmd_list_element * | tcp_set_cmdlist
static struct cmd_list_element * | tcp_show_cmdlist
static int | tcp_auto_retry = 1
static unsigned int | tcp_retry_limit = 15
static const struct serial_ops | tcp_ops

## Macro Definition Documentation

## ◆ POLL_INTERVAL

#define POLL_INTERVAL 5

Definition at line 82 of file ser-tcp.c.

Referenced by wait_for_connect().

## Function Documentation

## ◆ _initialize_ser_tcp()

void _initialize_ser_tcp | ( | void |  | ) |

Definition at line 414 of file ser-tcp.c.

References _, add_prefix_cmd(), add_setshow_boolean_cmd(), add_setshow_uinteger_cmd(), class_maintenance, class_obscure, serial_add_interface(), set_tcp_cmd(), setlist, show_tcp_cmd(), showlist, tcp_auto_retry, tcp_ops, tcp_retry_limit, tcp_set_cmdlist, and tcp_show_cmdlist.

## ◆ net_close()

void net_close | ( | struct serial * | scb | ) |

Definition at line 333 of file ser-tcp.c.

References serial::fd.

Referenced by net_open(), and net_windows_close().

## ◆ net_open()

int net_open | ( | struct serial * | scb,
|  | const char * | name
| ) |  |

Definition at line 159 of file ser-tcp.c.

References _, err, error(), serial::fd, fprintf_unfiltered(), gdb_socket_cloexec(), gdb_stderr, name, net_close(), startswith(), tcp_auto_retry, and wait_for_connect().

Referenced by net_windows_open().

## ◆ net_read_prim()

int net_read_prim | ( | struct serial * | scb,
|  | size_t | count
| ) |  |

Definition at line 343 of file ser-tcp.c.

References serial::buf, and serial::fd.

## ◆ net_write_prim()

int net_write_prim | ( | struct serial * | scb,
|  | const void * | buf,
|  | size_t | count
| ) |  |

Definition at line 352 of file ser-tcp.c.

References serial::fd.

## ◆ ser_tcp_send_break()

int ser_tcp_send_break | ( | struct serial * | scb | ) |

Definition at line 362 of file ser-tcp.c.

References serial_write().

## ◆ set_tcp_cmd()

static void set_tcp_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 371 of file ser-tcp.c.

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

Referenced by _initialize_ser_tcp().

## ◆ show_tcp_cmd()

static void show_tcp_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 377 of file ser-tcp.c.

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

Referenced by _initialize_ser_tcp().

## ◆ wait_for_connect()

static int wait_for_connect | ( | struct serial * | scb,
|  | unsigned int * | polls
| ) |  |
| static

Definition at line 89 of file ser-tcp.c.

References deprecated_ui_loop_hook, serial::fd, gdb_select(), POLL_INTERVAL, and tcp_retry_limit.

Referenced by net_open().

## Variable Documentation

## ◆ tcp_auto_retry

int tcp_auto_retry = 1
| static

Definition at line 74 of file ser-tcp.c.

Referenced by _initialize_ser_tcp(), and net_open().

## ◆ tcp_ops

const struct serial_ops tcp_ops
| static

Initial value:
=
{
"tcp",
net_open,
net_close,
NULL,
ser_base_readchar,
ser_base_write,
ser_base_flush_output,
ser_base_flush_input,
ser_tcp_send_break,
ser_base_raw,
ser_base_get_tty_state,
ser_base_copy_tty_state,
ser_base_set_tty_state,
ser_base_print_tty_state,
ser_base_setbaudrate,
ser_base_setstopbits,
ser_base_setparity,
ser_base_drain_output,
ser_base_async,
net_read_prim,
net_write_prim
}
ser_base_set_tty_state
int ser_base_set_tty_state(struct serial *scb, serial_ttystate ttystate)
Definition: ser-base.c:549
ser_base_flush_output
int ser_base_flush_output(struct serial *scb)
Definition: ser-base.c:498
net_write_prim
int net_write_prim(struct serial *scb, const void *buf, size_t count)
Definition: ser-tcp.c:352
ser_base_setbaudrate
int ser_base_setbaudrate(struct serial *scb, int rate)
Definition: ser-base.c:564
ser_base_setstopbits
int ser_base_setstopbits(struct serial *scb, int num)
Definition: ser-base.c:570
ser_base_raw
void ser_base_raw(struct serial *scb)
Definition: ser-base.c:529
ser_base_async
void ser_base_async(struct serial *scb, int async_p)
Definition: ser-base.c:586
net_read_prim
int net_read_prim(struct serial *scb, size_t count)
Definition: ser-tcp.c:343
ser_base_drain_output
int ser_base_drain_output(struct serial *scb)
Definition: ser-base.c:523
ser_base_print_tty_state
void ser_base_print_tty_state(struct serial *scb, serial_ttystate ttystate, struct ui_file *stream)
Definition: ser-base.c:555
ser_base_setparity
int ser_base_setparity(struct serial *scb, int parity)
Definition: ser-base.c:578
ser_base_flush_input
int ser_base_flush_input(struct serial *scb)
Definition: ser-base.c:504
ser_base_readchar
int ser_base_readchar(struct serial *scb, int timeout)
Definition: ser-base.c:468
ser_base_write
int ser_base_write(struct serial *scb, const void *buf, size_t count)
Definition: ser-base.c:474
net_close
void net_close(struct serial *scb)
Definition: ser-tcp.c:333
ser_tcp_send_break
int ser_tcp_send_break(struct serial *scb)
Definition: ser-tcp.c:362
ser_base_copy_tty_state
serial_ttystate ser_base_copy_tty_state(struct serial *scb, serial_ttystate ttystate)
Definition: ser-base.c:542
ser_base_get_tty_state
serial_ttystate ser_base_get_tty_state(struct serial *scb)
Definition: ser-base.c:535
net_open
int net_open(struct serial *scb, const char *name)
Definition: ser-tcp.c:159

Definition at line 386 of file ser-tcp.c.

Referenced by _initialize_ser_tcp().

## ◆ tcp_retry_limit

unsigned int tcp_retry_limit = 15
| static

Definition at line 78 of file ser-tcp.c.

Referenced by _initialize_ser_tcp(), and wait_for_connect().

## ◆ tcp_set_cmdlist

struct cmd_list_element* tcp_set_cmdlist
| static

Definition at line 69 of file ser-tcp.c.

Referenced by _initialize_ser_tcp(), and set_tcp_cmd().

## ◆ tcp_show_cmdlist

struct cmd_list_element* tcp_show_cmdlist
| static

Definition at line 70 of file ser-tcp.c.

Referenced by _initialize_ser_tcp(), and show_tcp_cmd().