From patchwork Tue Nov 28 13:23:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 24575 Received: (qmail 124616 invoked by alias); 28 Nov 2017 13:23:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 124597 invoked by uid 89); 28 Nov 2017 13:23:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KB_WAM_FROM_NAME_SINGLEWORD, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=biotechnology, Biotechnology, 1127, 1229 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 13:23:56 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 59C755F1 for ; Tue, 28 Nov 2017 14:23:53 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KKOA2xPDfN2N for ; Tue, 28 Nov 2017 14:23:51 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 35E105F0 for ; Tue, 28 Nov 2017 14:23:51 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id vASDNoSr028868; Tue, 28 Nov 2017 14:23:50 +0100 (MET) From: Rainer Orth To: gdb-patches@sourceware.org Subject: Fix sol-thread.c compilation on Solaris Date: Tue, 28 Nov 2017 14:23:50 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Building current gdb mainline with gcc 7.1 on Solaris 11.4 fails: /vol/src/gnu/gdb/gdb/dist/gdb/sol-thread.c: In function ‘void _initialize_sol_thread()’: /vol/src/gnu/gdb/gdb/dist/gdb/sol-thread.c:1229:66: error: invalid conversion from ‘void (*)(char*, int)’ to ‘void (*)(const char*, int)’ [-fpermissive] _("Show info on Solaris user threads."), &maintenanceinfolist); ^ In file included from /vol/src/gnu/gdb/gdb/dist/gdb/completer.h:21:0, from /vol/src/gnu/gdb/gdb/dist/gdb/symtab.h:31, from /vol/src/gnu/gdb/gdb/dist/gdb/language.h:26, from /vol/src/gnu/gdb/gdb/dist/gdb/frame.h:72, from /vol/src/gnu/gdb/gdb/dist/gdb/gdbarch.h:39, from /vol/src/gnu/gdb/gdb/dist/gdb/defs.h:557, from /vol/src/gnu/gdb/gdb/dist/gdb/sol-thread.c:51: /vol/src/gnu/gdb/gdb/dist/gdb/command.h:140:33: note: initializing argument 3 of ‘cmd_list_element* add_cmd(const char*, command_class, void (*)(const char*, int), const char*, cmd_list_element**)’ extern struct cmd_list_element *add_cmd (const char *, enum command_class, ^~~~~~~ The following patch allows compilation to succeed on i386-pc-solaris2.11 and sparc-sun-solaris2.11. Ok for mainline? Rainer # HG changeset patch # Parent d3867b61620919242bbc9d875d355487a4e71e96 Fix sol-thread.c compilation on Solaris diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -112,7 +112,7 @@ typedef td_err_e (td_ta_get_nthreads_fty typedef td_err_e (td_ta_tsd_iter_ftype)(const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p); typedef td_err_e (td_ta_thr_iter_ftype)(const td_thragent_t *ta_p, - td_thr_iter_f *cb, void *cbdata_p, + td_thr_iter_f *cb, const void *cbdata_p, td_thr_state_e state, int ti_pri, sigset_t *ti_sigmask_p, unsigned ti_user_flags); @@ -1122,7 +1122,7 @@ info_cb (const td_thrhandle_t *th, void inferior. */ static void -info_solthreads (char *args, int from_tty) +info_solthreads (const char *args, int from_tty) { p_td_ta_thr_iter (main_ta, info_cb, args, TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,