+2018-07-04 Vyacheslav Barinov <v.barinov@samsung.com>
+ Pedro Alves <palves@redhat.com>
+
+ * linux-nat.c (linux_init_ptrace): Rename to ...
+ (linux_init_ptrace_procfs): ... this. Call
+ linux_proc_init_warnings.
+ (linux_nat_target::post_attach)
+ (linux_nat_target::post_startup_inferior): Adjust.
+ * nat/linux-procfs.c (linux_proc_init_warnings): Define function.
+ * nat/linux-procfs.h (linux_proc_init_warnings): Declare function.
+
2018-07-04 Tom de Vries <tdevries@suse.de>
* dwarf2read.c (error_check_comp_unit_head): Move dwarf version
+2018-07-04 Vyacheslav Barinov <v.barinov@samsung.com>
+ Pedro Alves <palves@redhat.com>
+
+ * linux-low.c (initialize_low): Call linux_proc_init_warnings.
+
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
set_target_ops (&linux_target_ops);
linux_ptrace_init_warnings ();
+ linux_proc_init_warnings ();
sigchld_action.sa_handler = sigchld_handler;
sigemptyset (&sigchld_action.sa_mask);
return options;
}
-/* Initialize ptrace warnings and check for supported ptrace
- features given PID.
+/* Initialize ptrace and procfs warnings and check for supported
+ ptrace features given PID.
ATTACHED should be nonzero iff we attached to the inferior. */
static void
-linux_init_ptrace (pid_t pid, int attached)
+linux_init_ptrace_procfs (pid_t pid, int attached)
{
int options = linux_nat_ptrace_options (attached);
linux_enable_event_reporting (pid, options);
linux_ptrace_init_warnings ();
+ linux_proc_init_warnings ();
}
linux_nat_target::~linux_nat_target ()
void
linux_nat_target::post_attach (int pid)
{
- linux_init_ptrace (pid, 1);
+ linux_init_ptrace_procfs (pid, 1);
}
void
linux_nat_target::post_startup_inferior (ptid_t ptid)
{
- linux_init_ptrace (ptid.pid (), 0);
+ linux_init_ptrace_procfs (ptid.pid (), 0);
}
/* Return the number of known LWPs in the tgid given by 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."));
+}
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 */