From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18292 invoked by alias); 27 Apr 2012 15:32:20 -0000 Received: (qmail 18282 invoked by uid 22791); 27 Apr 2012 15:32:19 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_YF X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Apr 2012 15:32:05 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SNn9Q-0000Hc-Or from Maciej_Rozycki@mentor.com ; Fri, 27 Apr 2012 08:32:04 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 27 Apr 2012 08:32:02 -0700 Received: from [172.30.0.84] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.1.289.1; Fri, 27 Apr 2012 16:32:02 +0100 Date: Fri, 27 Apr 2012 15:34:00 -0000 From: "Maciej W. Rozycki" To: CC: Tom Tromey Subject: [PATCH] Solaris: Fix function prototype breakage in /proc services Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00997.txt.bz2 Hello, This change fixes a lot of: error: no previous prototype for 'foo' messages when building native for the sparc-solaris2.8 host/target. I went through all messages and decided from the context, on a case-by-case basis, whether the function in question should be made static or have a prototype added. Please let me know if I misdecided anywhere. This enables the configuration to build and work successfully. OK to apply? 2012-04-26 Maciej W. Rozycki gdb/ * 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. Maciej gdb-proc-fix.diff Index: gdb-fsf-trunk-quilt/gdb/procfs.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/procfs.c 2012-04-27 03:51:29.000000000 +0100 +++ gdb-fsf-trunk-quilt/gdb/procfs.c 2012-04-27 04:21:14.775549454 +0100 @@ -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_ADD } #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 *op /* 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, in } +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_procfs (void); + void _initialize_procfs (void) { Index: gdb-fsf-trunk-quilt/gdb/proc-events.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/proc-events.c 2012-02-24 15:23:42.000000000 +0000 +++ gdb-fsf-trunk-quilt/gdb/proc-events.c 2012-04-27 04:05:39.945578891 +0100 @@ -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 Index: gdb-fsf-trunk-quilt/gdb/proc-api.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/proc-api.c 2012-02-24 15:23:42.000000000 +0000 +++ gdb-fsf-trunk-quilt/gdb/proc-api.c 2012-04-27 04:22:16.025610845 +0100 @@ -775,6 +775,9 @@ proc_prettyfprint_status (long flags, in } +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_proc_api (void); + void _initialize_proc_api (void) { Index: gdb-fsf-trunk-quilt/gdb/proc-flags.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/proc-flags.c 2012-02-24 15:23:42.000000000 +0000 +++ gdb-fsf-trunk-quilt/gdb/proc-flags.c 2012-04-27 04:40:50.745434047 +0100 @@ -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 Index: gdb-fsf-trunk-quilt/gdb/proc-utils.h =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/proc-utils.h 2012-02-24 15:23:42.000000000 +0000 +++ gdb-fsf-trunk-quilt/gdb/proc-utils.h 2012-04-27 04:42:41.355608340 +0100 @@ -29,7 +29,16 @@ extern void proc_prettyprint_syscalls (s 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 ( 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 */ /*