GDB (xrefs)
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/ser-mingw.c File Reference
#include "defs.h"
#include "serial.h"
#include "ser-base.h"
#include "ser-tcp.h"
#include <windows.h>
#include <conio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include "gdb_assert.h"
#include "gdb_string.h"
#include "command.h"

Go to the source code of this file.

Classes

struct  ser_windows_state
struct  ser_console_state
struct  ser_console_ttystate
struct  pipe_state
struct  net_windows_state

Defines

#define CancelIo   dyn_CancelIo

Typedefs

typedef DWORD WINAPI(* thread_fn_type )(void *)

Enumerations

enum  select_thread_state { STS_STARTED, STS_STOPPED }

Functions

void _initialize_ser_windows (void)
static int ser_windows_open (struct serial *scb, const char *name)
static int ser_windows_drain_output (struct serial *scb)
static int ser_windows_flush_output (struct serial *scb)
static int ser_windows_flush_input (struct serial *scb)
static int ser_windows_send_break (struct serial *scb)
static void ser_windows_raw (struct serial *scb)
static int ser_windows_setstopbits (struct serial *scb, int num)
static int ser_windows_setbaudrate (struct serial *scb, int rate)
static void ser_windows_close (struct serial *scb)
static void ser_windows_wait_handle (struct serial *scb, HANDLE *read, HANDLE *except)
static int ser_windows_read_prim (struct serial *scb, size_t count)
static int ser_windows_write_prim (struct serial *scb, const void *buf, size_t len)
static void select_thread_wait (struct ser_console_state *state)
static void create_select_thread (thread_fn_type thread_fn, struct serial *scb, struct ser_console_state *state)
static void destroy_select_thread (struct ser_console_state *state)
static void start_select_thread (struct ser_console_state *state)
static void stop_select_thread (struct ser_console_state *state)
static DWORD WINAPI console_select_thread (void *arg)
static int fd_is_pipe (int fd)
static int fd_is_file (int fd)
static DWORD WINAPI pipe_select_thread (void *arg)
static DWORD WINAPI file_select_thread (void *arg)
static void ser_console_wait_handle (struct serial *scb, HANDLE *read, HANDLE *except)
static void ser_console_done_wait_handle (struct serial *scb)
static void ser_console_close (struct serial *scb)
static serial_ttystate ser_console_get_tty_state (struct serial *scb)
static struct pipe_statemake_pipe_state (void)
static void free_pipe_state (struct pipe_state *ps)
static void cleanup_pipe_state (void *untyped)
static int pipe_windows_open (struct serial *scb, const char *name)
static int pipe_windows_fdopen (struct serial *scb, int fd)
static void pipe_windows_close (struct serial *scb)
static int pipe_windows_read (struct serial *scb, size_t count)
static int pipe_windows_write (struct serial *scb, const void *buf, size_t count)
static void pipe_wait_handle (struct serial *scb, HANDLE *read, HANDLE *except)
static void pipe_done_wait_handle (struct serial *scb)
static int pipe_avail (struct serial *scb, int fd)
int gdb_pipe (int pdes[2])
static DWORD WINAPI net_windows_select_thread (void *arg)
static void net_windows_wait_handle (struct serial *scb, HANDLE *read, HANDLE *except)
static void net_windows_done_wait_handle (struct serial *scb)
static int net_windows_open (struct serial *scb, const char *name)
static void net_windows_close (struct serial *scb)

Variables

static BOOL WINAPI(* CancelIo )(HANDLE)

Define Documentation

#define CancelIo   dyn_CancelIo

Definition at line 49 of file ser-mingw.c.

Referenced by _initialize_ser_windows(), and ser_windows_close().


Typedef Documentation

typedef DWORD WINAPI(* thread_fn_type)(void *)

Definition at line 427 of file ser-mingw.c.


Enumeration Type Documentation

Enumerator:
STS_STARTED 
STS_STOPPED 

Definition at line 364 of file ser-mingw.c.


Function Documentation

void _initialize_ser_windows ( void  )

Definition at line 1214 of file ser-mingw.c.

References serial_ops::async, serial_ops::avail, CancelIo, serial_ops::close, serial_ops::copy_tty_state, serial_ops::drain_output, serial_ops::fdopen, serial_ops::flush_input, serial_ops::flush_output, serial_ops::get_tty_state, serial_ops::go_raw, memset(), serial_ops::name, net_read_prim(), net_windows_close(), net_windows_done_wait_handle(), net_windows_open(), net_windows_wait_handle(), net_write_prim(), serial_ops::next, serial_ops::noflush_set_tty_state, serial_ops::open, pipe_avail(), pipe_done_wait_handle(), pipe_wait_handle(), pipe_windows_close(), pipe_windows_fdopen(), pipe_windows_open(), pipe_windows_read(), pipe_windows_write(), serial_ops::print_tty_state, serial_ops::read_prim, serial_ops::readchar, serial_ops::send_break, ser_base_async(), ser_base_copy_tty_state(), ser_base_drain_output(), ser_base_flush_input(), ser_base_flush_output(), ser_base_get_tty_state(), ser_base_noflush_set_tty_state(), ser_base_print_tty_state(), ser_base_raw(), ser_base_readchar(), ser_base_send_break(), ser_base_set_tty_state(), ser_base_setbaudrate(), ser_base_setstopbits(), ser_base_write(), ser_console_close(), ser_console_done_wait_handle(), ser_console_get_tty_state(), ser_console_wait_handle(), ser_tcp_send_break(), ser_windows_close(), ser_windows_drain_output(), ser_windows_flush_input(), ser_windows_flush_output(), ser_windows_open(), ser_windows_raw(), ser_windows_read_prim(), ser_windows_send_break(), ser_windows_setbaudrate(), ser_windows_setstopbits(), ser_windows_wait_handle(), ser_windows_write_prim(), serial_add_interface(), serial_ops::set_tty_state, serial_ops::setbaudrate, serial_ops::setstopbits, serial_ops::write, serial_ops::write_prim, and XMALLOC.

static void cleanup_pipe_state ( void *  untyped) [static]

Definition at line 829 of file ser-mingw.c.

References free_pipe_state(), and cleanup_check::ps.

Referenced by pipe_windows_open().

static DWORD WINAPI console_select_thread ( void *  arg) [static]
static void create_select_thread ( thread_fn_type  thread_fn,
struct serial scb,
struct ser_console_state state 
) [static]
static void destroy_select_thread ( struct ser_console_state state) [static]
static int fd_is_file ( int  fd) [static]

Definition at line 599 of file ser-mingw.c.

Referenced by ser_console_wait_handle().

static int fd_is_pipe ( int  fd) [static]

Definition at line 590 of file ser-mingw.c.

Referenced by ser_console_wait_handle().

static DWORD WINAPI file_select_thread ( void *  arg) [static]
static void free_pipe_state ( struct pipe_state ps) [static]
int gdb_pipe ( int  pdes[2])

Definition at line 1035 of file ser-mingw.c.

static struct pipe_state* make_pipe_state ( void  ) [static, read]
static void net_windows_close ( struct serial scb) [static]
static void net_windows_done_wait_handle ( struct serial scb) [static]

Definition at line 1167 of file ser-mingw.c.

References net_windows_state::base, serial::state, and stop_select_thread().

Referenced by _initialize_ser_windows().

static int net_windows_open ( struct serial scb,
const char *  name 
) [static]
static DWORD WINAPI net_windows_select_thread ( void *  arg) [static]
static void net_windows_wait_handle ( struct serial scb,
HANDLE *  read,
HANDLE *  except 
) [static]
static int pipe_avail ( struct serial scb,
int  fd 
) [static]

Definition at line 1023 of file ser-mingw.c.

References BOOL.

Referenced by _initialize_ser_windows().

static void pipe_done_wait_handle ( struct serial scb) [static]
static DWORD WINAPI pipe_select_thread ( void *  arg) [static]
static void pipe_wait_handle ( struct serial scb,
HANDLE *  read,
HANDLE *  except 
) [static]
static void pipe_windows_close ( struct serial scb) [static]

Definition at line 932 of file ser-mingw.c.

References free_pipe_state(), cleanup_check::ps, and serial::state.

Referenced by _initialize_ser_windows().

static int pipe_windows_fdopen ( struct serial scb,
int  fd 
) [static]
static int pipe_windows_open ( struct serial scb,
const char *  name 
) [static]
static int pipe_windows_read ( struct serial scb,
size_t  count 
) [static]

Definition at line 945 of file ser-mingw.c.

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

Referenced by _initialize_ser_windows().

static int pipe_windows_write ( struct serial scb,
const void *  buf,
size_t  count 
) [static]

Definition at line 968 of file ser-mingw.c.

References pipe_state::input, cleanup_check::ps, and serial::state.

Referenced by _initialize_ser_windows().

static void select_thread_wait ( struct ser_console_state state) [static]
static void ser_console_close ( struct serial scb) [static]

Definition at line 743 of file ser-mingw.c.

References destroy_select_thread(), serial::state, and xfree().

Referenced by _initialize_ser_windows().

static void ser_console_done_wait_handle ( struct serial scb) [static]

Definition at line 732 of file ser-mingw.c.

References serial::state, and stop_select_thread().

Referenced by _initialize_ser_windows().

static serial_ttystate ser_console_get_tty_state ( struct serial scb) [static]

Definition at line 760 of file ser-mingw.c.

References serial::fd, ser_console_ttystate::is_a_tty, and xmalloc().

Referenced by _initialize_ser_windows().

static void ser_console_wait_handle ( struct serial scb,
HANDLE *  read,
HANDLE *  except 
) [static]
static void ser_windows_close ( struct serial scb) [static]
static int ser_windows_drain_output ( struct serial scb) [static]

Definition at line 110 of file ser-mingw.c.

References serial::fd.

Referenced by _initialize_ser_windows().

static int ser_windows_flush_input ( struct serial scb) [static]

Definition at line 126 of file ser-mingw.c.

References serial::fd.

Referenced by _initialize_ser_windows().

static int ser_windows_flush_output ( struct serial scb) [static]

Definition at line 118 of file ser-mingw.c.

References serial::fd.

Referenced by _initialize_ser_windows().

static int ser_windows_open ( struct serial scb,
const char *  name 
) [static]
static void ser_windows_raw ( struct serial scb) [static]

Definition at line 151 of file ser-mingw.c.

References _, serial::current_timeout, serial::fd, and warning().

Referenced by _initialize_ser_windows().

static int ser_windows_read_prim ( struct serial scb,
size_t  count 
) [static]
static int ser_windows_send_break ( struct serial scb) [static]

Definition at line 134 of file ser-mingw.c.

References serial::fd.

Referenced by _initialize_ser_windows().

static int ser_windows_setbaudrate ( struct serial scb,
int  rate 
) [static]

Definition at line 205 of file ser-mingw.c.

References serial::fd, and rate.

Referenced by _initialize_ser_windows().

static int ser_windows_setstopbits ( struct serial scb,
int  num 
) [static]
static void ser_windows_wait_handle ( struct serial scb,
HANDLE *  read,
HANDLE *  except 
) [static]
static int ser_windows_write_prim ( struct serial scb,
const void *  buf,
size_t  len 
) [static]

Definition at line 327 of file ser-mingw.c.

References serial::fd, memset(), and ser_windows_state::ov.

Referenced by _initialize_ser_windows().

static void start_select_thread ( struct ser_console_state state) [static]
static void stop_select_thread ( struct ser_console_state state) [static]

Variable Documentation

BOOL WINAPI(* CancelIo)(HANDLE) [static]

Definition at line 50 of file ser-mingw.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines