From: Maciej W. Rozycki Date: Fri, 27 Apr 2012 18:32:33 +0000 (+0000) Subject: * proc-utils.h (proc_prettyprint_signalset): New prototype. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0911fd0206cb727a3fd2f9b1227121bdd616838;p=binutils-gdb.git * proc-utils.h (proc_prettyprint_signalset): New prototype. (proc_prettyprint_signal): Likewise. (proc_prettyprint_faultset): Likewise. (proc_prettyprint_fault): Likewise. (proc_prettyprint_actionset): Likewise. (proc_prettyprint_flags): Move to new proc-flags.c section. (proc_prettyfprint_flags): New prototype. * procfs.c (proc_nsysarg, proc_sysargs): Add prototypes. (proc_syscall, proc_cursig): Likewise. (proc_set_kill_on_last_close): Likewise. (proc_unset_kill_on_last_close): Likewise. (proc_set_watchpoint): Make static. (proc_delete_dead_threads): Likewise. (procfs_set_watchpoint): Likewise. (_initialize_procfs): Add prototype. * proc-events.c: Include proc-utils.h. (init_syscall_table): Make static. * proc-api.c (_initialize_proc_api): Add prototype. * proc-flags.c: Include proc-utils.h. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3c692a5a065..4c37ae3421b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,25 @@ +2012-04-26 Maciej W. Rozycki + + * proc-utils.h (proc_prettyprint_signalset): New prototype. + (proc_prettyprint_signal): Likewise. + (proc_prettyprint_faultset): Likewise. + (proc_prettyprint_fault): Likewise. + (proc_prettyprint_actionset): Likewise. + (proc_prettyprint_flags): Move to new proc-flags.c section. + (proc_prettyfprint_flags): New prototype. + * procfs.c (proc_nsysarg, proc_sysargs): Add prototypes. + (proc_syscall, proc_cursig): Likewise. + (proc_set_kill_on_last_close): Likewise. + (proc_unset_kill_on_last_close): Likewise. + (proc_set_watchpoint): Make static. + (proc_delete_dead_threads): Likewise. + (procfs_set_watchpoint): Likewise. + (_initialize_procfs): Add prototype. + * proc-events.c: Include proc-utils.h. + (init_syscall_table): Make static. + * proc-api.c (_initialize_proc_api): Add prototype. + * proc-flags.c: Include proc-utils.h. + 2012-04-26 Maciej W. Rozycki * configure.ac: Add AC_ARG_PROGRAM. diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 19732a74823..876d08c246d 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -775,6 +775,9 @@ proc_prettyfprint_status (long flags, int why, int what, int thread) } +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_proc_api (void); + void _initialize_proc_api (void) { diff --git a/gdb/proc-events.c b/gdb/proc-events.c index fa56e34c388..216a65aa55a 100644 --- a/gdb/proc-events.c +++ b/gdb/proc-events.c @@ -45,6 +45,8 @@ #include #endif +#include "proc-utils.h" + /* Much of the information used in the /proc interface, particularly for printing status information, is kept as tables of structures of the following form. These tables can be used to map numeric values @@ -105,7 +107,7 @@ struct trans #define MAX_SYSCALLS 262 /* Pretty arbitrary. */ static char *syscall_table[MAX_SYSCALLS]; -void +static void init_syscall_table (void) { #ifdef SYS_BSD_getime diff --git a/gdb/proc-flags.c b/gdb/proc-flags.c index 35f12128ac7..57eca906ff1 100644 --- a/gdb/proc-flags.c +++ b/gdb/proc-flags.c @@ -35,6 +35,8 @@ #include #include +#include "proc-utils.h" + /* Much of the information used in the /proc interface, particularly for printing status information, is kept as tables of structures of the following form. These tables can be used to map numeric values to diff --git a/gdb/proc-utils.h b/gdb/proc-utils.h index b45d44bc7fb..a462d6e1d88 100644 --- a/gdb/proc-utils.h +++ b/gdb/proc-utils.h @@ -29,7 +29,16 @@ extern void proc_prettyprint_syscalls (sysset_t *sysset, int verbose); extern void proc_prettyprint_syscall (int num, int verbose); -extern void proc_prettyprint_flags (unsigned long flags, int verbose); +extern void proc_prettyprint_signalset (sigset_t *sigset, int verbose); + +extern void proc_prettyprint_signal (int signo, int verbose); + +extern void proc_prettyprint_faultset (fltset_t *fltset, int verbose); + +extern void proc_prettyprint_fault (int faultno, int verbose); + +extern void proc_prettyprint_actionset (struct sigaction *actions, + int verbose); extern void proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose); @@ -55,6 +64,18 @@ extern void proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, extern void proc_prettyfprint_status (long, int, int, int); +/* From proc-flags.c */ + +/* + * Pretty-print the prstatus flags. + */ + +extern void proc_prettyprint_flags (unsigned long flags, int verbose); + +extern void proc_prettyfprint_flags (FILE *file, unsigned long flags, + int verbose); + + /* From proc-api.c */ /* diff --git a/gdb/procfs.c b/gdb/procfs.c index d7c2946bffc..e39e12134f1 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -1023,8 +1023,14 @@ int proc_get_status (procinfo * pi); long proc_flags (procinfo * pi); int proc_why (procinfo * pi); int proc_what (procinfo * pi); +int proc_nsysarg (procinfo * pi); +long *proc_sysargs (procinfo * pi); +int proc_syscall (procinfo * pi); +long proc_cursig (struct procinfo * pi); int proc_set_run_on_last_close (procinfo * pi); int proc_unset_run_on_last_close (procinfo * pi); +int proc_set_kill_on_last_close (procinfo * pi); +int proc_unset_kill_on_last_close (procinfo * pi); int proc_set_inherit_on_fork (procinfo * pi); int proc_unset_inherit_on_fork (procinfo * pi); int proc_set_async (procinfo * pi); @@ -2673,7 +2679,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) } #endif -int +static int proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags) { #if !defined (PCWATCH) && !defined (PIOCSWATCH) @@ -2943,7 +2949,7 @@ proc_get_current_thread (procinfo *pi) unfortunately requires a different method on every OS. Returns non-zero for success, zero for failure. */ -int +static int proc_delete_dead_threads (procinfo *parent, procinfo *thread, void *ignore) { if (thread && parent) /* sanity */ @@ -5019,7 +5025,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) /* Insert a watchpoint. */ -int +static int procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, int after) { @@ -5573,6 +5579,9 @@ proc_untrace_sysexit_cmd (char *args, int from_tty) } +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_procfs (void); + void _initialize_procfs (void) {