From patchwork Tue Apr 4 17:25:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 19831 Received: (qmail 116746 invoked by alias); 4 Apr 2017 17:26:17 -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 116491 invoked by uid 89); 4 Apr 2017 17:26:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hung, sk:record_, 7667, TRY X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 17:26:14 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 779154E4F3 for ; Tue, 4 Apr 2017 17:26:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 779154E4F3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 779154E4F3 Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87C8318247 for ; Tue, 4 Apr 2017 17:26:13 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 15/18] -Wwrite-strings: execute_command calls with string literals Date: Tue, 4 Apr 2017 18:25:48 +0100 Message-Id: <1491326751-16180-16-git-send-email-palves@redhat.com> In-Reply-To: <1491326751-16180-1-git-send-email-palves@redhat.com> References: <1491326751-16180-1-git-send-email-palves@redhat.com> This is ugly, but it's just making the uglyness explicit. All these places would better be calling some API function directly instead of going through execute_command & friends... gdb/ChangeLog: yyyy-mm-dd Pedro Alves * event-top.c (command_line_handler): Add cast to execute_command call. * record-btrace.c (cmd_record_btrace_bts_start) (cmd_record_btrace_pt_start, cmd_record_btrace_start) (cmd_record_btrace_start): Add cast to execute_command call. * record-full.c (record_full_goto_insn): * record.c (record_start, record_stop): Add cast to execute_command_to_string calls. (cmd_record_start): Add cast to execute_command calls. --- gdb/event-top.c | 2 +- gdb/record-btrace.c | 8 ++++---- gdb/record-full.c | 2 +- gdb/record.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gdb/event-top.c b/gdb/event-top.c index 5d8d077..dd2770a 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -766,7 +766,7 @@ command_line_handler (char *rl) hung up but GDB is still alive. In such a case, we just quit gdb killing the inferior program too. */ printf_unfiltered ("quit\n"); - execute_command ("quit", 1); + execute_command ((char *) "quit", 1); } else if (cmd == NULL) { diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index af025e2..61fba1e 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -2897,7 +2897,7 @@ cmd_record_btrace_bts_start (char *args, int from_tty) TRY { - execute_command ("target record-btrace", from_tty); + execute_command ((char *) "target record-btrace", from_tty); } CATCH (exception, RETURN_MASK_ALL) { @@ -2919,7 +2919,7 @@ cmd_record_btrace_pt_start (char *args, int from_tty) TRY { - execute_command ("target record-btrace", from_tty); + execute_command ((char *) "target record-btrace", from_tty); } CATCH (exception, RETURN_MASK_ALL) { @@ -2941,7 +2941,7 @@ cmd_record_btrace_start (char *args, int from_tty) TRY { - execute_command ("target record-btrace", from_tty); + execute_command ((char *) "target record-btrace", from_tty); } CATCH (exception, RETURN_MASK_ALL) { @@ -2949,7 +2949,7 @@ cmd_record_btrace_start (char *args, int from_tty) TRY { - execute_command ("target record-btrace", from_tty); + execute_command ((char *) "target record-btrace", from_tty); } CATCH (exception, RETURN_MASK_ALL) { diff --git a/gdb/record-full.c b/gdb/record-full.c index bd95acc..31ff558 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -2788,7 +2788,7 @@ record_full_goto_insn (struct record_full_entry *entry, static void cmd_record_full_start (char *args, int from_tty) { - execute_command ("target record-full", from_tty); + execute_command ((char *) "target record-full", from_tty); } static void diff --git a/gdb/record.c b/gdb/record.c index eff8fe1..16e5b03 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -99,25 +99,25 @@ record_start (const char *method, const char *format, int from_tty) if (method == NULL) { if (format == NULL) - execute_command_to_string ("record", from_tty); + execute_command_to_string ((char *) "record", from_tty); else error (_("Invalid format.")); } else if (strcmp (method, "full") == 0) { if (format == NULL) - execute_command_to_string ("record full", from_tty); + execute_command_to_string ((char *) "record full", from_tty); else error (_("Invalid format.")); } else if (strcmp (method, "btrace") == 0) { if (format == NULL) - execute_command_to_string ("record btrace", from_tty); + execute_command_to_string ((char *) "record btrace", from_tty); else if (strcmp (format, "bts") == 0) - execute_command_to_string ("record btrace bts", from_tty); + execute_command_to_string ((char *) "record btrace bts", from_tty); else if (strcmp (format, "pt") == 0) - execute_command_to_string ("record btrace pt", from_tty); + execute_command_to_string ((char *) "record btrace pt", from_tty); else error (_("Invalid format.")); } @@ -130,7 +130,7 @@ record_start (const char *method, const char *format, int from_tty) void record_stop (int from_tty) { - execute_command_to_string ("record stop", from_tty); + execute_command_to_string ((char *) "record stop", from_tty); } /* See record.h. */ @@ -265,7 +265,7 @@ show_record_debug (struct ui_file *file, int from_tty, static void cmd_record_start (char *args, int from_tty) { - execute_command ("target record-full", from_tty); + execute_command ((char *) "target record-full", from_tty); } /* Truncate the record log from the present point