GDB (xrefs)
Classes | Defines | Typedefs | Functions | Variables
/home/stan/gdb/src/gdb/event-loop.c File Reference
#include "defs.h"
#include "event-loop.h"
#include "event-top.h"
#include "queue.h"
#include <sys/types.h>
#include "gdb_string.h"
#include <errno.h>
#include <sys/time.h>
#include "exceptions.h"
#include "gdb_assert.h"
#include "gdb_select.h"

Go to the source code of this file.

Classes

union  event_data
struct  gdb_event
struct  file_handler
struct  async_signal_handler
struct  async_event_handler
struct  gdb_timer
struct  async_event_handler_data

Defines

#define GDB_READABLE   (1<<1)
#define GDB_WRITABLE   (1<<2)
#define GDB_EXCEPTION   (1<<3)
#define USE_POLL   0

Typedefs

typedef union event_data event_data
typedef struct gdb_event gdb_event
typedef void( event_handler_func )(event_data)
typedef struct gdb_eventgdb_event_p
typedef struct file_handler file_handler
typedef struct async_signal_handler async_signal_handler
typedef struct async_event_handler async_event_handler

Functions

 DECLARE_QUEUE_P (gdb_event_p)
 DEFINE_QUEUE_P (gdb_event_p)
static QUEUE (gdb_event_p)
static int invoke_async_signal_handlers (void)
static void create_file_handler (int fd, int mask, handler_func *proc, gdb_client_data client_data)
static void handle_file_event (event_data data)
static void check_async_event_handlers (void)
static int gdb_wait_for_event (int)
static void poll_timers (void)
static gdb_eventcreate_event (event_handler_func proc, event_data data)
static gdb_eventcreate_file_event (int fd)
static void gdb_event_xfree (struct gdb_event *event)
void initialize_event_loop (void)
static int process_event (void)
int gdb_do_one_event (void)
void start_event_loop (void)
void add_file_handler (int fd, handler_func *proc, gdb_client_data client_data)
void delete_file_handler (int fd)
async_signal_handlercreate_async_signal_handler (sig_handler_func *proc, gdb_client_data client_data)
void call_async_signal_handler (struct async_signal_handler *handler)
void mark_async_signal_handler (async_signal_handler *async_handler_ptr)
void delete_async_signal_handler (async_signal_handler **async_handler_ptr)
async_event_handlercreate_async_event_handler (async_event_handler_func *proc, gdb_client_data client_data)
void mark_async_event_handler (async_event_handler *async_handler_ptr)
static void invoke_async_event_handler (event_data data)
void delete_async_event_handler (async_event_handler **async_handler_ptr)
int create_timer (int milliseconds, timer_handler_func *proc, gdb_client_data client_data)
void delete_timer (int id)
static void handle_timer_event (event_data dummy)

Variables

 gdb_notifier
struct {
   struct gdb_timer *   first_timer
   int   num_timers
timer_list
struct {
   async_signal_handler *   first_handler
   async_signal_handler *   last_handler
sighandler_list
struct {
   async_event_handler *   first_handler
   async_event_handler *   last_handler
async_event_handler_list

Define Documentation

#define GDB_EXCEPTION   (1<<3)
#define GDB_READABLE   (1<<1)
#define GDB_WRITABLE   (1<<2)

Definition at line 45 of file event-loop.c.

Referenced by create_file_handler(), delete_file_handler(), and gdb_wait_for_event().

#define USE_POLL   0

Referenced by QUEUE().


Typedef Documentation

typedef union event_data event_data
typedef void( event_handler_func)(event_data)

Definition at line 56 of file event-loop.c.

typedef struct file_handler file_handler
typedef struct gdb_event gdb_event

Definition at line 55 of file event-loop.c.

typedef struct gdb_event * gdb_event_p

Function Documentation

void add_file_handler ( int  fd,
handler_func proc,
gdb_client_data  client_data 
)
void call_async_signal_handler ( struct async_signal_handler handler)
static void check_async_event_handlers ( void  ) [static]
static gdb_event* create_event ( event_handler_func  proc,
event_data  data 
) [static]

Definition at line 263 of file event-loop.c.

References gdb_timer::proc, and xmalloc().

Referenced by check_async_event_handlers(), and create_file_event().

static gdb_event* create_file_event ( int  fd) [static]

Definition at line 279 of file event-loop.c.

References create_event(), handle_file_event(), and event_data::integer.

Referenced by gdb_wait_for_event().

static void create_file_handler ( int  fd,
int  mask,
handler_func proc,
gdb_client_data  client_data 
) [static]
int create_timer ( int  milliseconds,
timer_handler_func proc,
gdb_client_data  client_data 
)
void delete_async_event_handler ( async_event_handler **  async_handler_ptr)
void delete_async_signal_handler ( async_signal_handler **  async_handler_ptr)
void delete_file_handler ( int  fd)
void delete_timer ( int  id)

Definition at line 1206 of file event-loop.c.

References gdb_notifier, gdb_timer::next, gdb_timer::timer_id, timer_list, and xfree().

Referenced by reschedule(), and ser_base_async().

int gdb_do_one_event ( void  )
static void gdb_event_xfree ( struct gdb_event event) [static]

Definition at line 291 of file event-loop.c.

References xfree().

Referenced by initialize_event_loop(), and process_event().

static int gdb_wait_for_event ( int  block) [static]
static void handle_file_event ( event_data  data) [static]
static void handle_timer_event ( event_data  dummy) [static]
void initialize_event_loop ( void  )

Definition at line 299 of file event-loop.c.

References gdb_event_xfree(), and QUEUE_alloc.

Referenced by gdb_init().

static void invoke_async_event_handler ( event_data  data) [static]
static int invoke_async_signal_handlers ( void  ) [static]
void mark_async_event_handler ( async_event_handler async_handler_ptr)
void mark_async_signal_handler ( async_signal_handler async_handler_ptr)
static void poll_timers ( void  ) [static]

Definition at line 1276 of file event-loop.c.

References _, gdb_notifier, handle_timer_event(), internal_error(), QUEUE_enque, timer_list, and xmalloc().

Referenced by gdb_do_one_event().

static int process_event ( void  ) [static]
static QUEUE ( gdb_event_p  ) [static]

Definition at line 143 of file event-loop.c.

References USE_POLL.

void start_event_loop ( void  )

Variable Documentation

struct { ... } async_event_handler_list [static]

Definition at line 230 of file event-loop.c.

Definition at line 218 of file event-loop.c.

Definition at line 233 of file event-loop.c.

Definition at line 221 of file event-loop.c.

struct { ... } sighandler_list [static]
struct { ... } timer_list [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines