binutils-gdb/gdb/nat
Vyacheslav Barinov 1b919490e8 Warn if /proc is not accessible
There's a buildroot where I want to debug a binary, and I tried to
connect to it from outside, but got very weird errors like
architecture mismatch or protocol errors.  At last, after switching on
'--debug' for gdbserver I found a message 'Can't open /proc/pid/'
message and suddenly found that I forgot to mount procfs in my
buildroot.

Make discovering the problem easier by making GDB / GDBserver warn
(even without --debug) if /proc can not be accessed.

Native debugging:

 (gdb) start
 Temporary breakpoint 1 at 0x400835: file test.c, line 10.
 Starting program: /tmp/test
 warning: /proc is not accessible.

GDBserver/remote debugging:

 $ ./gdbserver :9999 ./gdbserver
 gdbserver: /proc is not accessible.

gdb/ChangeLog:
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.

gdb/gdbserver/ChangeLog:
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-04 16:13:29 +01:00
..
aarch64-linux-hw-point.c Remove ptid_get_lwp 2018-07-03 11:36:43 -06:00
aarch64-linux-hw-point.h
aarch64-linux.c Remove ptid_get_lwp 2018-07-03 11:36:43 -06:00
aarch64-linux.h
aarch64-sve-linux-ptrace.c Ptrace support for Aarch64 SVE 2018-06-18 10:06:53 +01:00
aarch64-sve-linux-ptrace.h Fix up HAS_SVE_STATE macro 2018-06-22 12:01:18 +01:00
aarch64-sve-linux-sigcontext.h Add Aarch64 SVE compatibility macros 2018-06-18 10:02:56 +01:00
amd64-linux-siginfo.c
amd64-linux-siginfo.h
fork-inferior.c Remove pid_to_ptid 2018-07-03 11:36:42 -06:00
fork-inferior.h
gdb_ptrace.h
gdb_thread_db.h
glibc_thread_db.h
linux-btrace.c Remove ptid_get_lwp 2018-07-03 11:36:43 -06:00
linux-btrace.h
linux-namespaces.c
linux-namespaces.h
linux-nat.h
linux-osdata.c Remove ptid_get_lwp 2018-07-03 11:36:43 -06:00
linux-osdata.h
linux-personality.c
linux-personality.h
linux-procfs.c Warn if /proc is not accessible 2018-07-04 16:13:29 +01:00
linux-procfs.h Warn if /proc is not accessible 2018-07-04 16:13:29 +01:00
linux-ptrace.c
linux-ptrace.h Fix Alpha native GDB build 2018-05-31 11:18:35 -04:00
linux-waitpid.c
linux-waitpid.h
mips-linux-watch.c
mips-linux-watch.h
ppc-linux.c [PowerPC] Consolidate wordsize getter between native and gdbserver 2018-05-22 11:52:02 -03:00
ppc-linux.h [PowerPC] Consolidate wordsize getter between native and gdbserver 2018-05-22 11:52:02 -03:00
x86-cpuid.h
x86-dregs.c
x86-dregs.h
x86-gcc-cpuid.h
x86-linux-dregs.c Remove ptid_lwp_p 2018-07-03 11:36:45 -06:00
x86-linux-dregs.h
x86-linux.c
x86-linux.h