]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/procfs.c
Various procfs.c cleanups
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 21 Jun 2020 16:51:58 +0000 (18:51 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 21 Jun 2020 16:51:58 +0000 (18:51 +0200)
commit196535a69c8568342e62fdf5e3f5ade04470fd6a
tree6eeace8b5bccc8a58ea632f6f38562155098867c
parentcf6f3e86ded2cd950f59a0f2c164f2c953ef534b
Various procfs.c cleanups

While reading through procfs.c, I noticed a couple of cleanup
opportunities:

* Some comments and code allowed for portability across different
  targets.  Since procfs.c is Solaris-only for some time now, those can
  go.

* Likewise, there were some references to the old ioctl-based /proc left.

* The code still allowed for SYS_exec.  However, it is no longer present
  in either Solaris 11.3, 11.4, or Illumos.  Checking the OpenSolaris
  sources, I found that it had already been removed in 2010 well before
  the Solaris 11 release.

* Some blocks of #if 0 code can go:

** References to struct procinfo.{g,fp}regs_dirty which are no longer
   defined.

** Code handling the PR_ASLWP flag where <sys/procfs.h> has

#define PR_ASLWP   0x00000040 /* obsolete flag; never set */

Tested on amd64-pc-solaris2.11.

* procfs.c: Cleanup many comments.

(READ_WATCHFLAG, WRITE_WATCHFLAG, EXEC_WATCHFLAG)
(AFTER_WATCHFLAG): Replace by value.

(MAIN_PROC_NAME_FORMAT): Inline ...
(create_procinfo): ... here.

(procfs_debug_inferior): Remove SYS_exec handling.
(syscall_is_exec): Likewise.
(procfs_set_exec_trap): Likewise.

(syscall_is_lwp_exit): Inline in callers.
(syscall_is_exit): Likewise.
(syscall_is_exec): Likewise.
(syscall_is_lwp_create): Likewise.

(invalidate_cache): Remove #if 0 code.

(make_signal_thread_runnable):  Remove.
(procfs_target::resume): Remove #if 0 code.
gdb/ChangeLog
gdb/procfs.c