GDBserver
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/lynx-low.c File Reference
#include "server.h"
#include "target.h"
#include "lynx-low.h"
#include <limits.h>
#include <sys/ptrace.h>
#include <sys/piddef.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include "gdb_wait.h"
#include <signal.h>
#include "filestuff.h"

Go to the source code of this file.

Classes

struct  process_info_private

Defines

#define CASE(X)   case X: return #X

Functions

static void lynx_debug (char *string,...)
static ptid_t lynx_ptid_build (int pid, long tid)
static int lynx_ptid_get_pid (ptid_t ptid)
static long lynx_ptid_get_tid (ptid_t ptid)
static int lynx_ptrace_pid_from_ptid (ptid_t ptid)
static char * ptrace_request_to_str (int request)
static int lynx_ptrace (int request, ptid_t ptid, int addr, int data, int addr2)
static struct process_infolynx_add_process (int pid, int attached)
static int lynx_create_inferior (char *program, char **allargs)
static void lynx_add_threads_after_attach (int pid)
static int lynx_attach (unsigned long pid)
static void lynx_resume (struct thread_resume *resume_info, size_t n)
static void lynx_continue (ptid_t ptid)
static int lynx_waitpid (int pid, int *stat_loc)
static ptid_t lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options)
static ptid_t lynx_wait (ptid_t ptid, struct target_waitstatus *status, int options)
static int lynx_kill (int pid)
static int lynx_detach (int pid)
static void lynx_mourn (struct process_info *proc)
static void lynx_join (int pid)
static int lynx_thread_alive (ptid_t ptid)
static void lynx_fetch_registers (struct regcache *regcache, int regno)
static void lynx_store_registers (struct regcache *regcache, int regno)
static int lynx_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
static int lynx_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
static void lynx_request_interrupt (void)
void initialize_low (void)

Variables

int using_threads = 1
struct target_desclynx_tdesc
static struct target_ops lynx_target_ops

Define Documentation

#define CASE (   X)    case X: return #X

Referenced by ptrace_request_to_str().


Function Documentation

void initialize_low ( void  )

Definition at line 757 of file lynx-low.c.

References linux_target_ops::arch_setup, set_target_ops(), and the_low_target.

static struct process_info* lynx_add_process ( int  pid,
int  attached 
) [static, read]
static void lynx_add_threads_after_attach ( int  pid) [static]

Definition at line 269 of file lynx-low.c.

References add_thread(), find_thread_ptid(), lynx_debug(), lynx_ptid_build(), and perror_with_name().

Referenced by lynx_attach().

static int lynx_attach ( unsigned long  pid) [static]
static void lynx_continue ( ptid_t  ptid) [static]

Definition at line 356 of file lynx-low.c.

References thread_resume::kind, lynx_resume(), thread_resume::sig, and thread_resume::thread.

Referenced by lynx_wait_1().

static int lynx_create_inferior ( char *  program,
char **  allargs 
) [static]
static void lynx_debug ( char *  string,
  ... 
) [static]
static int lynx_detach ( int  pid) [static]
static void lynx_fetch_registers ( struct regcache regcache,
int  regno 
) [static]
static void lynx_join ( int  pid) [static]

Definition at line 563 of file lynx-low.c.

static int lynx_kill ( int  pid) [static]
static void lynx_mourn ( struct process_info proc) [static]

Definition at line 551 of file lynx-low.c.

References clear_inferiors(), and process_info::private.

static ptid_t lynx_ptid_build ( int  pid,
long  tid 
) [static]

Definition at line 65 of file lynx-low.c.

References ptid_build().

Referenced by lynx_add_threads_after_attach(), lynx_attach(), lynx_detach(), lynx_kill(), and lynx_wait_1().

static int lynx_ptid_get_pid ( ptid_t  ptid) [static]

Definition at line 82 of file lynx-low.c.

References ptid_get_pid().

Referenced by lynx_ptrace_pid_from_ptid(), lynx_request_interrupt(), lynx_wait(), and lynx_wait_1().

static long lynx_ptid_get_tid ( ptid_t  ptid) [static]

Definition at line 90 of file lynx-low.c.

References ptid_get_lwp().

Referenced by lynx_ptrace_pid_from_ptid(), lynx_wait(), and lynx_wait_1().

static int lynx_ptrace ( int  request,
ptid_t  ptid,
int  addr,
int  data,
int  addr2 
) [static]
static int lynx_ptrace_pid_from_ptid ( ptid_t  ptid) [static]

Definition at line 101 of file lynx-low.c.

References lynx_ptid_get_pid(), and lynx_ptid_get_tid().

Referenced by lynx_ptrace().

static int lynx_read_memory ( CORE_ADDR  memaddr,
unsigned char *  myaddr,
int  len 
) [static]

Definition at line 639 of file lynx-low.c.

References current_inferior, errno, lynx_ptrace(), memcpy(), and thread_to_gdb_id().

Referenced by lynx_write_memory().

static void lynx_request_interrupt ( void  ) [static]

Definition at line 711 of file lynx-low.c.

References current_inferior, lynx_ptid_get_pid(), and thread_to_gdb_id().

static void lynx_resume ( struct thread_resume resume_info,
size_t  n 
) [static]
static void lynx_store_registers ( struct regcache regcache,
int  regno 
) [static]
static int lynx_thread_alive ( ptid_t  ptid) [static]

Definition at line 572 of file lynx-low.c.

References find_thread_ptid().

static ptid_t lynx_wait ( ptid_t  ptid,
struct target_waitstatus *  status,
int  options 
) [static]

Definition at line 499 of file lynx-low.c.

References lynx_debug(), lynx_ptid_get_pid(), lynx_ptid_get_tid(), and lynx_wait_1().

Referenced by lynx_kill().

static ptid_t lynx_wait_1 ( ptid_t  ptid,
struct target_waitstatus *  status,
int  options 
) [static]
static int lynx_waitpid ( int  pid,
int *  stat_loc 
) [static]

Definition at line 371 of file lynx-low.c.

References errno, and perror_with_name().

Referenced by lynx_wait_1().

static int lynx_write_memory ( CORE_ADDR  memaddr,
const unsigned char *  myaddr,
int  len 
) [static]
static char* ptrace_request_to_str ( int  request) [static]

Definition at line 109 of file lynx-low.c.

References CASE.

Referenced by lynx_ptrace().


Variable Documentation

struct target_ops lynx_target_ops [static]

Definition at line 720 of file lynx-low.c.

Definition at line 34 of file lynx-low.c.

Referenced by lynx_add_process(), lynx_i386_arch_setup(), and lynx_ppc_arch_setup().

int using_threads = 1

Definition at line 32 of file lynx-low.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines