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 |  | ) |

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

References _, add_setshow_boolean_cmd(), add_setshow_filename_cmd(), no_class, procfs_filename, procfs_trace, set_procfs_file_cmd(), set_procfs_trace_cmd(), setlist, and showlist.

## ◆ 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

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

References procfs_file, procfs_filename, and procfs_trace.

Referenced by close_with_trace(), lseek_with_trace(), open_with_trace(), proc_prettyfprint_status(), procfs_note(), wait_with_trace(), and write_with_trace().

## ◆ proc_prettyfprint_status()

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

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

References flags, prepare_to_trace(), proc_prettyfprint_flags(), proc_prettyfprint_why(), procfs_file, and procfs_trace.

## ◆ 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
| ) |  |

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

References trans::desc, info_verbose, lseek_offset, trans::name, name, prepare_to_trace(), proc_prettyfprint_faultset(), proc_prettyfprint_signal(), proc_prettyfprint_signalset(), proc_prettyfprint_syscalls(), procfs_file, procfs_trace, rw_table, and safe_strerror().

## 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

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

Referenced by close_with_trace(), lseek_with_trace(), open_with_trace(), prepare_to_trace(), proc_prettyfprint_status(), procfs_note(), set_procfs_file_cmd(), set_procfs_trace_cmd(), wait_with_trace(), and write_with_trace().

## ◆ 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

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

Referenced by _initialize_proc_api(), close_with_trace(), lseek_with_trace(), open_with_trace(), prepare_to_trace(), proc_prettyfprint_status(), procfs_note(), wait_with_trace(), and write_with_trace().

## ◆ rw_table

struct trans rw_table[]
| static

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

Referenced by write_with_trace().