From patchwork Mon Jun 9 14:15:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1375 Received: (qmail 7976 invoked by alias); 9 Jun 2014 14:16:05 -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 7724 invoked by uid 89); 9 Jun 2014 14:16:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 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; Mon, 09 Jun 2014 14:16:01 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s59EG0YW012830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 9 Jun 2014 10:16:00 -0400 Received: from barimba.redhat.com (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s59EFwZw023035; Mon, 9 Jun 2014 10:15:59 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/3] constify to_disconnect Date: Mon, 9 Jun 2014 08:15:53 -0600 Message-Id: <1402323354-27308-3-git-send-email-tromey@redhat.com> In-Reply-To: <1402323354-27308-1-git-send-email-tromey@redhat.com> References: <1402323354-27308-1-git-send-email-tromey@redhat.com> This constifies an parameter of to_disconnect and updates target_disconnect as well. 2014-06-09 Tom Tromey * target.h (struct target_ops) : Make parameter const. (target_disconnect): Update. * target.c (target_disconnect): Make "args" const. * target-delegates.c: Rebuild. * remote.c (remote_disconnect): Update. * record.h (record_disconnect): Update. * record.c (record_disconnect): Update. * inf-child.c (inf_child_disconnect): Update. --- gdb/ChangeLog | 12 ++++++++++++ gdb/inf-child.c | 2 +- gdb/record.c | 2 +- gdb/record.h | 2 +- gdb/remote.c | 2 +- gdb/target-delegates.c | 4 ++-- gdb/target.c | 2 +- gdb/target.h | 4 ++-- 8 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gdb/inf-child.c b/gdb/inf-child.c index dbadde8..897e635 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -140,7 +140,7 @@ inf_child_open (char *arg, int from_tty) /* Implement the to_disconnect target_ops method. */ static void -inf_child_disconnect (struct target_ops *target, char *args, int from_tty) +inf_child_disconnect (struct target_ops *target, const char *args, int from_tty) { if (args != NULL) error (_("Argument given to \"disconnect\".")); diff --git a/gdb/record.c b/gdb/record.c index 5a7a88c..b801b7f 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -130,7 +130,7 @@ record_unpush (struct target_ops *t) /* See record.h. */ void -record_disconnect (struct target_ops *t, char *args, int from_tty) +record_disconnect (struct target_ops *t, const char *args, int from_tty) { gdb_assert (t->to_stratum == record_stratum); diff --git a/gdb/record.h b/gdb/record.h index f5987e3..29784ad 100644 --- a/gdb/record.h +++ b/gdb/record.h @@ -57,7 +57,7 @@ extern int record_read_memory (struct gdbarch *gdbarch, extern void cmd_record_goto (char *arg, int from_tty); /* The default "to_disconnect" target method for record targets. */ -extern void record_disconnect (struct target_ops *, char *, int); +extern void record_disconnect (struct target_ops *, const char *, int); /* The default "to_detach" target method for record targets. */ extern void record_detach (struct target_ops *, const char *, int); diff --git a/gdb/remote.c b/gdb/remote.c index 43e25ae..6174070 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4347,7 +4347,7 @@ extended_remote_detach (struct target_ops *ops, const char *args, int from_tty) /* Same as remote_detach, but don't send the "D" packet; just disconnect. */ static void -remote_disconnect (struct target_ops *target, char *args, int from_tty) +remote_disconnect (struct target_ops *target, const char *args, int from_tty) { if (args) error (_("Argument given to \"disconnect\" when remotely debugging.")); diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 522d52b..4eefae8 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -28,14 +28,14 @@ tdefault_detach (struct target_ops *self, const char *arg1, int arg2) } static void -delegate_disconnect (struct target_ops *self, char *arg1, int arg2) +delegate_disconnect (struct target_ops *self, const char *arg1, int arg2) { self = self->beneath; self->to_disconnect (self, arg1, arg2); } static void -tdefault_disconnect (struct target_ops *self, char *arg1, int arg2) +tdefault_disconnect (struct target_ops *self, const char *arg1, int arg2) { tcomplain (); } diff --git a/gdb/target.c b/gdb/target.c index a9255d7..f3226b9 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2087,7 +2087,7 @@ target_detach (const char *args, int from_tty) } void -target_disconnect (char *args, int from_tty) +target_disconnect (const char *args, int from_tty) { /* If we're in breakpoints-always-inserted mode or if breakpoints are global across processes, we have to remove them before diff --git a/gdb/target.h b/gdb/target.h index 87d2a83..7f9714e 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -414,7 +414,7 @@ struct target_ops TARGET_DEFAULT_IGNORE (); void (*to_detach) (struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE (); - void (*to_disconnect) (struct target_ops *, char *, int) + void (*to_disconnect) (struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN (tcomplain ()); void (*to_resume) (struct target_ops *, ptid_t, int, enum gdb_signal) TARGET_DEFAULT_NORETURN (noprocess ()); @@ -1177,7 +1177,7 @@ extern void target_detach (const char *, int); /* Disconnect from the current target without resuming it (leaving it waiting for a debugger). */ -extern void target_disconnect (char *, int); +extern void target_disconnect (const char *, int); /* Resume execution of the target process PTID (or a group of threads). STEP says whether to single-step or to run free; SIGGNAL