From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43132 invoked by alias); 6 Jan 2019 22:46:44 -0000 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 Received: (qmail 42993 invoked by uid 89); 6 Jan 2019 22:46:43 -0000 Authentication-Results: sourceware.org; auth=none 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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=STATE, EVENT X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.216) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Jan 2019 22:46:40 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway33.websitewelcome.com (Postfix) with ESMTP id BB99CB892 for ; Sun, 6 Jan 2019 16:46:38 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id gHBmgKrJB2PzOgHBmg01EJ; Sun, 06 Jan 2019 16:46:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FbPzLO/ib6g1EO66tEb3xGH7IpXva5LMJasdKUhOnqY=; b=EU9pJ83/JB80h+U8yZ3vanGQFf yuhgzdqlqrLPIXzid43AXVBvbDRMd+wCdg7druf3+EFflORd+vKxcb8KZPU+yGf6b70gZ35KiEeX7 +uyd0V0tPhUEmptBTyMKD0QEo; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:38864 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1ggHBm-001jE9-IH; Sun, 06 Jan 2019 16:46:38 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] Constify some remote-notif functions Date: Sun, 06 Jan 2019 22:46:00 -0000 Message-Id: <20190106224636.5271-4-tom@tromey.com> In-Reply-To: <20190106224636.5271-1-tom@tromey.com> References: <20190106224636.5271-1-tom@tromey.com> X-SW-Source: 2019-01/txt/msg00097.txt.bz2 This constifies the "buf" arguments to various remote-notif functions and updates the users. 2019-01-06 Tom Tromey * remote-notif.c (handle_notification, remote_notif_ack) (remote_notif_parse): Make "buf" const. * remote-notif.h (struct notif_client) : Make "buf" const. (remote_notif_parse, remote_notif_ack, handle_notification): Likewise. * remote.c (remote_notif_stop_parse): Make "buf" const. (remote_target::remote_parse_stop_reply): Make "buf" const. (remote_notif_stop_ack): Make "buf" const. --- gdb/ChangeLog | 12 ++++++++++++ gdb/remote-notif.c | 6 +++--- gdb/remote-notif.h | 11 ++++++----- gdb/remote.c | 8 ++++---- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c index 9ccb5b9120..ae9a94d9c9 100644 --- a/gdb/remote-notif.c +++ b/gdb/remote-notif.c @@ -59,7 +59,7 @@ static void do_notif_event_xfree (void *arg); void remote_notif_ack (remote_target *remote, - struct notif_client *nc, char *buf) + struct notif_client *nc, const char *buf) { struct notif_event *event = nc->alloc_event (); struct cleanup *old_chain @@ -79,7 +79,7 @@ remote_notif_ack (remote_target *remote, struct notif_event * remote_notif_parse (remote_target *remote, - struct notif_client *nc, char *buf) + struct notif_client *nc, const char *buf) { struct notif_event *event = nc->alloc_event (); struct cleanup *old_chain @@ -126,7 +126,7 @@ remote_async_get_pending_events_handler (gdb_client_data data) update STATE. */ void -handle_notification (struct remote_notif_state *state, char *buf) +handle_notification (struct remote_notif_state *state, const char *buf) { struct notif_client *nc; size_t i; diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h index a4a931b4b7..7973ad7fa0 100644 --- a/gdb/remote-notif.h +++ b/gdb/remote-notif.h @@ -55,13 +55,13 @@ typedef struct notif_client function may throw exception if contents in BUF is not the expected event. */ void (*parse) (remote_target *remote, - struct notif_client *self, char *buf, + struct notif_client *self, const char *buf, struct notif_event *event); /* Send field to remote, and do some checking. If something wrong, throw an exception. */ void (*ack) (remote_target *remote, - struct notif_client *self, char *buf, + struct notif_client *self, const char *buf, struct notif_event *event); /* Check this notification client can get pending events in @@ -106,15 +106,16 @@ struct remote_notif_state struct notif_event *pending_event[REMOTE_NOTIF_LAST]; }; -void remote_notif_ack (remote_target *remote, notif_client *nc, char *buf); +void remote_notif_ack (remote_target *remote, notif_client *nc, + const char *buf); struct notif_event *remote_notif_parse (remote_target *remote, notif_client *nc, - char *buf); + const char *buf); void notif_event_xfree (struct notif_event *event); void handle_notification (struct remote_notif_state *notif_state, - char *buf); + const char *buf); void remote_notif_process (struct remote_notif_state *state, struct notif_client *except); diff --git a/gdb/remote.c b/gdb/remote.c index 6b5870a70a..949c69c1cc 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -768,7 +768,7 @@ public: /* Remote specific methods. */ struct stop_reply *remote_notif_remove_queued_reply (ptid_t ptid); struct stop_reply *queued_stop_reply (ptid_t ptid); int peek_stop_reply (ptid_t ptid); - void remote_parse_stop_reply (char *buf, stop_reply *event); + void remote_parse_stop_reply (const char *buf, stop_reply *event); void remote_stop_ns (ptid_t ptid); void remote_interrupt_as (); @@ -6864,7 +6864,7 @@ remote_target::stop_reply_queue_length () void remote_notif_stop_parse (remote_target *remote, - struct notif_client *self, char *buf, + struct notif_client *self, const char *buf, struct notif_event *event) { remote->remote_parse_stop_reply (buf, (struct stop_reply *) event); @@ -6872,7 +6872,7 @@ remote_notif_stop_parse (remote_target *remote, static void remote_notif_stop_ack (remote_target *remote, - struct notif_client *self, char *buf, + struct notif_client *self, const char *buf, struct notif_event *event) { struct stop_reply *stop_reply = (struct stop_reply *) event; @@ -7201,7 +7201,7 @@ strprefix (const char *p, const char *pend, const char *prefix) result is stored in EVENT, or throws an error. */ void -remote_target::remote_parse_stop_reply (char *buf, stop_reply *event) +remote_target::remote_parse_stop_reply (const char *buf, stop_reply *event) { remote_arch_state *rsa = NULL; ULONGEST addr; -- 2.17.2