|
GDBserver
|
#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.
| #define MAX_PID_T_STRLEN (sizeof ("-9223372036854775808") - 1) |
Definition at line 60 of file linux-osdata.c.
Referenced by get_cores_used_by_process(), get_process_owner(), linux_common_core_of_thread(), linux_xfer_osdata_processes(), and linux_xfer_osdata_processgroups().
| 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.
| static void command_from_pid | ( | char * | command, |
| int | maxlen, | ||
| PID_T | pid | ||
| ) | [static] |
Definition at line 126 of file linux-osdata.c.
References gdb_fopen_cloexec(), xfree(), and xstrprintf().
Referenced by commandline_from_pid(), linux_xfer_osdata_fds(), linux_xfer_osdata_msg(), linux_xfer_osdata_processgroups(), linux_xfer_osdata_shm(), and linux_xfer_osdata_threads().
| static char* commandline_from_pid | ( | PID_T | pid | ) | [static] |
Definition at line 165 of file linux-osdata.c.
References command_from_pid(), gdb_fopen_cloexec(), memcpy(), xfree(), xmalloc(), xrealloc(), and xstrprintf().
Referenced by linux_xfer_osdata_processes(), and linux_xfer_osdata_processgroups().
| 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] |
Definition at line 263 of file linux-osdata.c.
References dirent, linux_common_core_of_thread(), MAX_PID_T_STRLEN, NAMELEN, and ptid_build().
Referenced by linux_xfer_osdata_processes().
| 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] |
Definition at line 1056 of file linux-osdata.c.
Referenced by linux_xfer_osdata_msg(), linux_xfer_osdata_sem(), and linux_xfer_osdata_shm().
| int linux_common_core_of_thread | ( | ptid_t | ptid | ) |
Definition at line 67 of file linux-osdata.c.
References gdb_fopen_cloexec(), MAX_PID_T_STRLEN, ptid_get_lwp(), ptid_get_pid(), strchr(), xfree(), and xrealloc().
Referenced by get_cores_used_by_process(), and linux_xfer_osdata_threads().
| LONGEST linux_common_xfer_osdata | ( | const char * | annex, |
| gdb_byte * | readbuf, | ||
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) |
Definition at line 1551 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), gdb_assert, memcpy(), offset, osdata_table, and osdata_type::type.
Referenced by linux_qxfer_osdata().
| static LONGEST linux_xfer_osdata_fds | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 679 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), command_from_pid(), dirent, memcpy(), NAMELEN, offset, xfree(), and xstrprintf().
| static LONGEST linux_xfer_osdata_isockets | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 993 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), memcpy(), offset, and print_sockets().
| static LONGEST linux_xfer_osdata_modules | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 1440 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), gdb_fopen_cloexec(), memcpy(), name, and offset.
| static LONGEST linux_xfer_osdata_msg | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 1314 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), command_from_pid(), gdb_fopen_cloexec(), group_from_gid(), memcpy(), offset, time_from_time_t(), and user_from_uid().
| static LONGEST linux_xfer_osdata_processes | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 301 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), commandline_from_pid(), dirent, get_cores_used_by_process(), get_process_owner(), MAX_PID_T_STRLEN, memcpy(), NAMELEN, offset, user_from_uid(), xcalloc(), and xfree().
| static LONGEST linux_xfer_osdata_processgroups | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 449 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), command_from_pid(), commandline_from_pid(), compare_processes(), dirent, MAX_PID_T_STRLEN, memcpy(), NAMELEN, offset, xfree(), xmalloc(), and xrealloc().
| static LONGEST linux_xfer_osdata_sem | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 1202 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), gdb_fopen_cloexec(), group_from_gid(), memcpy(), offset, time_from_time_t(), and user_from_uid().
| static LONGEST linux_xfer_osdata_shm | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 1074 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), command_from_pid(), gdb_fopen_cloexec(), group_from_gid(), memcpy(), offset, time_from_time_t(), and user_from_uid().
| static LONGEST linux_xfer_osdata_threads | ( | gdb_byte * | readbuf, |
| ULONGEST | offset, | ||
| LONGEST | len | ||
| ) | [static] |
Definition at line 565 of file linux-osdata.c.
References buffer_finish(), buffer_free(), buffer_grow_str, buffer_grow_str0, buffer_init(), buffer_xml_printf(), command_from_pid(), dirent, linux_common_core_of_thread(), memcpy(), NAMELEN, offset, ptid_build(), xfree(), and xstrprintf().
| static void print_sockets | ( | unsigned short | family, |
| int | tcp, | ||
| struct buffer * | buffer | ||
| ) | [static] |
Definition at line 852 of file linux-osdata.c.
References buffer_xml_printf(), format_socket_state(), gdb_fopen_cloexec(), socket_addr::sa, socket_addr::sin, socket_addr::sin6, and user_from_uid().
Referenced by linux_xfer_osdata_isockets().
| static void time_from_time_t | ( | char * | time, |
| int | maxlen, | ||
| TIME_T | seconds | ||
| ) | [static] |
Definition at line 1039 of file linux-osdata.c.
Referenced by linux_xfer_osdata_msg(), linux_xfer_osdata_sem(), and linux_xfer_osdata_shm().
| static void user_from_uid | ( | char * | user, |
| int | maxlen, | ||
| uid_t | uid | ||
| ) | [static] |
Definition at line 224 of file linux-osdata.c.
Referenced by linux_xfer_osdata_msg(), linux_xfer_osdata_processes(), linux_xfer_osdata_sem(), linux_xfer_osdata_shm(), and print_sockets().
| struct osdata_type osdata_table[] |
Referenced by linux_common_xfer_osdata().
1.7.6.1