diff options
Diffstat (limited to 'gdb/nat')
-rw-r--r-- | gdb/nat/linux-procfs.c | 17 | ||||
-rw-r--r-- | gdb/nat/linux-procfs.h | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 1c236c5..6c15ea5 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -357,3 +357,20 @@ linux_proc_pid_to_exec_file (int pid) return buf; } + +/* See linux-procfs.h. */ + +void +linux_proc_init_warnings () +{ + static bool warned = false; + + if (warned) + return; + warned = true; + + struct stat st; + + if (stat ("/proc/self", &st) != 0) + warning (_("/proc is not accessible.")); +} diff --git a/gdb/nat/linux-procfs.h b/gdb/nat/linux-procfs.h index efb2911..2f8932e 100644 --- a/gdb/nat/linux-procfs.h +++ b/gdb/nat/linux-procfs.h @@ -80,4 +80,9 @@ extern int linux_proc_task_list_dir_exists (pid_t pid); extern char *linux_proc_pid_to_exec_file (int pid); +/* Display possible problems on this system. Display them only once + per GDB execution. */ + +extern void linux_proc_init_warnings (); + #endif /* COMMON_LINUX_PROCFS_H */ |