projects
/
platform
/
upstream
/
binutils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace hexify with bin2hex
[platform/upstream/binutils.git]
/
gdb
/
common
/
linux-osdata.c
diff --git
a/gdb/common/linux-osdata.c
b/gdb/common/linux-osdata.c
index
37a31f2
..
805850c
100644
(file)
--- a/
gdb/common/linux-osdata.c
+++ b/
gdb/common/linux-osdata.c
@@
-1,6
+1,6
@@
/* Linux-specific functions to retrieve OS data.
/* Linux-specific functions to retrieve OS data.
- Copyright (C) 2009-201
3
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
4
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-42,10
+42,12
@@
#include "xml-utils.h"
#include "buffer.h"
#include "gdb_assert.h"
#include "xml-utils.h"
#include "buffer.h"
#include "gdb_assert.h"
-#include
"gdb_dirent.h"
-#include
"gdb_stat.h"
+#include
<dirent.h>
+#include
<sys/stat.h>
#include "filestuff.h"
#include "filestuff.h"
+#define NAMELEN(dirent) strlen ((dirent)->d_name)
+
/* Define PID_T to be a fixed size that is at least as large as pid_t,
so that reading pid values embedded in /proc works
consistently. */
/* Define PID_T to be a fixed size that is at least as large as pid_t,
so that reading pid values embedded in /proc works
consistently. */
@@
-299,7
+301,7
@@
get_cores_used_by_process (PID_T pid, int *cores)
static LONGEST
linux_xfer_osdata_processes (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_processes (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
@@
-447,7
+449,7
@@
compare_processes (const void *process1, const void *process2)
static LONGEST
linux_xfer_osdata_processgroups (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_processgroups (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
@@
-563,7
+565,7
@@
linux_xfer_osdata_processgroups (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_threads (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_threads (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
@@
-677,7
+679,7
@@
linux_xfer_osdata_threads (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_fds (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_fds (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
{
/* We make the process list snapshot when the object starts to be read. */
static const char *buf;
@@
-984,7
+986,7
@@
print_sockets (unsigned short family, int tcp, struct buffer *buffer)
static LONGEST
linux_xfer_osdata_isockets (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_isockets (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
static const char *buf;
static LONGEST len_avail = -1;
{
static const char *buf;
static LONGEST len_avail = -1;
@@
-1065,7
+1067,7
@@
group_from_gid (char *group, int maxlen, gid_t gid)
static LONGEST
linux_xfer_osdata_shm (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_shm (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
static const char *buf;
static LONGEST len_avail = -1;
{
static const char *buf;
static LONGEST len_avail = -1;
@@
-1193,7
+1195,7
@@
linux_xfer_osdata_shm (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_sem (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_sem (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
static const char *buf;
static LONGEST len_avail = -1;
{
static const char *buf;
static LONGEST len_avail = -1;
@@
-1305,7
+1307,7
@@
linux_xfer_osdata_sem (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_msg (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_msg (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
static const char *buf;
static LONGEST len_avail = -1;
{
static const char *buf;
static LONGEST len_avail = -1;
@@
-1431,7
+1433,7
@@
linux_xfer_osdata_msg (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_modules (gdb_byte *readbuf,
static LONGEST
linux_xfer_osdata_modules (gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
static const char *buf;
static LONGEST len_avail = -1;
{
static const char *buf;
static LONGEST len_avail = -1;
@@
-1540,7
+1542,7
@@
struct osdata_type {
char *type;
char *title;
char *description;
char *type;
char *title;
char *description;
- LONGEST (*getter) (gdb_byte *readbuf, ULONGEST offset, LONGEST len);
+ LONGEST (*getter) (gdb_byte *readbuf, ULONGEST offset,
U
LONGEST len);
} osdata_table[] = {
{ "processes", "Processes", "Listing of all processes",
linux_xfer_osdata_processes },
} osdata_table[] = {
{ "processes", "Processes", "Listing of all processes",
linux_xfer_osdata_processes },
@@
-1565,7
+1567,7
@@
struct osdata_type {
LONGEST
linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
LONGEST
linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
- ULONGEST offset, LONGEST len)
+ ULONGEST offset,
U
LONGEST len)
{
if (!annex || *annex == '\0')
{
{
if (!annex || *annex == '\0')
{