GDB (xrefs)
Classes | Defines | Typedefs | Functions | Variables
/home/stan/gdb/src/gdb/common/linux-osdata.c File Reference
#include "defs.h"
#include "linux-osdata.h"
#include <sys/types.h>
#include <sys/sysinfo.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <utmp.h>
#include <time.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "xml-utils.h"
#include "buffer.h"
#include "gdb_assert.h"
#include "gdb_dirent.h"
#include "gdb_stat.h"
#include "filestuff.h"

Go to the source code of this file.

Classes

union  socket_addr
struct  osdata_type

Defines

#define MAX_PID_T_STRLEN   (sizeof ("-9223372036854775808") - 1)

Typedefs

typedef long long PID_T
typedef long long TIME_T

Functions

int linux_common_core_of_thread (ptid_t ptid)
static void command_from_pid (char *command, int maxlen, PID_T pid)
static char * commandline_from_pid (PID_T pid)
static void user_from_uid (char *user, int maxlen, uid_t uid)
static int get_process_owner (uid_t *owner, PID_T pid)
static int get_cores_used_by_process (PID_T pid, int *cores)
static LONGEST linux_xfer_osdata_processes (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static int compare_processes (const void *process1, const void *process2)
static LONGEST linux_xfer_osdata_processgroups (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static LONGEST linux_xfer_osdata_threads (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static LONGEST linux_xfer_osdata_fds (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static const char * format_socket_state (unsigned char state)
static void print_sockets (unsigned short family, int tcp, struct buffer *buffer)
static LONGEST linux_xfer_osdata_isockets (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static void time_from_time_t (char *time, int maxlen, TIME_T seconds)
static void group_from_gid (char *group, int maxlen, gid_t gid)
static LONGEST linux_xfer_osdata_shm (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static LONGEST linux_xfer_osdata_sem (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static LONGEST linux_xfer_osdata_msg (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
static LONGEST linux_xfer_osdata_modules (gdb_byte *readbuf, ULONGEST offset, LONGEST len)
LONGEST linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf, ULONGEST offset, LONGEST len)

Variables

struct osdata_type osdata_table []

Define Documentation

#define MAX_PID_T_STRLEN   (sizeof ("-9223372036854775808") - 1)

Typedef Documentation

typedef long long PID_T

Definition at line 53 of file linux-osdata.c.

typedef long long TIME_T

Definition at line 58 of file linux-osdata.c.


Function Documentation

static void command_from_pid ( char *  command,
int  maxlen,
PID_T  pid 
) [static]
static char* commandline_from_pid ( PID_T  pid) [static]
static int compare_processes ( const void *  process1,
const void *  process2 
) [static]

Definition at line 418 of file linux-osdata.c.

Referenced by linux_xfer_osdata_processgroups().

static const char* format_socket_state ( unsigned char  state) [static]

Definition at line 793 of file linux-osdata.c.

Referenced by print_sockets().

static int get_cores_used_by_process ( PID_T  pid,
int cores 
) [static]
static int get_process_owner ( uid_t *  owner,
PID_T  pid 
) [static]

Definition at line 242 of file linux-osdata.c.

References MAX_PID_T_STRLEN.

Referenced by linux_xfer_osdata_processes().

static void group_from_gid ( char *  group,
int  maxlen,
gid_t  gid 
) [static]
LONGEST linux_common_xfer_osdata ( const char *  annex,
gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
)
static LONGEST linux_xfer_osdata_fds ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_isockets ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_modules ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_msg ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_processes ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_processgroups ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_sem ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_shm ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static LONGEST linux_xfer_osdata_threads ( gdb_byte readbuf,
ULONGEST  offset,
LONGEST  len 
) [static]
static void print_sockets ( unsigned short  family,
int  tcp,
struct buffer buffer 
) [static]
static void time_from_time_t ( char *  time,
int  maxlen,
TIME_T  seconds 
) [static]
static void user_from_uid ( char *  user,
int  maxlen,
uid_t  uid 
) [static]

Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines