GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/proc-api.c File Reference
#include "defs.h"
#include "gdbcmd.h"
#include "completer.h"
#include <sys/types.h>
#include <sys/procfs.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <fcntl.h>
#include "gdb_wait.h"
#include "proc-utils.h"

Go to the source code of this file.

Classes

struct  trans
 

Macros

#define _STRUCTURED_PROC   1
 

Functions

static void prepare_to_trace (void)
 
static void set_procfs_trace_cmd (const char *args, int from_tty, struct cmd_list_element *c)
 
static void set_procfs_file_cmd (const char *args, int from_tty, struct cmd_list_element *c)
 
int write_with_trace (int fd, void *varg, size_t len, char *file, int line)
 
off_t lseek_with_trace (int fd, off_t offset, int whence, char *file, int line)
 
int open_with_trace (char *filename, int mode, char *file, int line)
 
int close_with_trace (int fd, char *file, int line)
 
pid_t wait_with_trace (int *wstat, char *file, int line)
 
void procfs_note (const char *msg, const char *file, int line)
 
void proc_prettyfprint_status (long flags, int why, int what, int thread)
 
void _initialize_proc_api (void)
 

Variables

static int procfs_trace = 0
 
static FILE * procfs_file = NULL
 
static char * procfs_filename
 
static struct trans rw_table []
 
static off_t lseek_offset
 

Macro Definition Documentation

◆ _STRUCTURED_PROC

#define _STRUCTURED_PROC   1

Definition at line 31 of file proc-api.c.

Function Documentation

◆ _initialize_proc_api()

void _initialize_proc_api ( void  )

◆ close_with_trace()

int close_with_trace ( int  fd,
char *  file,
int  line 
)

Definition at line 323 of file proc-api.c.

References info_verbose, prepare_to_trace(), procfs_file, procfs_trace, and safe_strerror().

◆ lseek_with_trace()

off_t lseek_with_trace ( int  fd,
off_t  offset,
int  whence,
char *  file,
int  line 
)

Definition at line 261 of file proc-api.c.

References lseek_offset, offset, prepare_to_trace(), procfs_file, procfs_trace, and safe_strerror().

◆ open_with_trace()

int open_with_trace ( char *  filename,
int  mode,
char *  file,
int  line 
)

Definition at line 282 of file proc-api.c.

References info_verbose, prepare_to_trace(), procfs_file, procfs_trace, and safe_strerror().

◆ prepare_to_trace()

static void prepare_to_trace ( void  )
static

◆ proc_prettyfprint_status()

void proc_prettyfprint_status ( long  flags,
int  why,
int  what,
int  thread 
)

◆ procfs_note()

void procfs_note ( const char *  msg,
const char *  file,
int  line 
)

Definition at line 384 of file proc-api.c.

References info_verbose, prepare_to_trace(), procfs_file, and procfs_trace.

◆ set_procfs_file_cmd()

static void set_procfs_file_cmd ( const char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

Definition at line 76 of file proc-api.c.

References procfs_file.

Referenced by _initialize_proc_api().

◆ set_procfs_trace_cmd()

static void set_procfs_trace_cmd ( const char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

Definition at line 66 of file proc-api.c.

References procfs_file.

Referenced by _initialize_proc_api().

◆ wait_with_trace()

pid_t wait_with_trace ( int *  wstat,
char *  file,
int  line 
)

Definition at line 349 of file proc-api.c.

References info_verbose, prepare_to_trace(), procfs_file, procfs_trace, and safe_strerror().

◆ write_with_trace()

int write_with_trace ( int  fd,
void *  varg,
size_t  len,
char *  file,
int  line 
)

Variable Documentation

◆ lseek_offset

off_t lseek_offset
static

Definition at line 118 of file proc-api.c.

Referenced by lseek_with_trace(), and write_with_trace().

◆ procfs_file

FILE* procfs_file = NULL
static

◆ procfs_filename

char* procfs_filename
static

Definition at line 55 of file proc-api.c.

Referenced by _initialize_proc_api(), and prepare_to_trace().

◆ procfs_trace

int procfs_trace = 0
static

◆ rw_table

struct trans rw_table[]
static

Definition at line 86 of file proc-api.c.

Referenced by write_with_trace().